1
1

Compare commits

...

4596 Commits

Author SHA1 Message Date
abd2ee4a8d Attribute Compare: Use the most complex data type instead of the least 2020-12-10 09:31:42 -06:00
98b1e09d06 Optimize comparisons by squaring threshold first 2020-12-10 09:09:44 -06:00
4bdb67d5c0 Merge branch 'master' into geometry-nodes-point-separate-node 2020-12-10 08:55:44 -06: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
62953c2bf3 Geometry Nodes: Support equality operations with all data types
Testing equality of vectors can't be done properly if they are implicitly
converted to float before-hand. This adds a lot of boilerplate code to
the node, maybe that can made more elegant in the future, but it's not
so complicated anyway.
2020-12-09 16:42:23 -06:00
0e757da3b5 Geometry Nodes: Add a method to find the lowest complexity attribute
For the attribute comparison node, it makes sense to read both input
attributes implicitly converted to the same data type. But the choice
of which of the two data types to read with is somewhat arbitrary.
This commit adds a utility function to choose the least "complex" data
type as a lowest common denominator, to make that choice less arbitrary
, and to support other needs in the future.
2020-12-09 16:33:09 -06:00
200cbb6adf Geometry Nodes: Add utilities for getting an attribute's data type
With the previous helper function in this file you had to know the data
type you wanted for the input attribute before requesting it. This adds
another utility function for getting the data type without building the
attribute. The attribute's can be requested later after doing some
logic to figure out the right data type to read.

No functional changes in this commit.
2020-12-09 16:29:49 -06: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
c61c9f61c6 Use new get_input_attribute abstraction 2020-12-09 10:29:29 -06: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
9acba6f716 Merge branch 'master' into geometry-nodes-point-separate-node 2020-12-09 09:53:17 -06:00
81fb9720fe Support meshes in addition to point clouds 2020-12-09 09:43:32 -06: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
96feddd85f Use text for comparison RNA enum items 2020-12-09 09:00:24 -06: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
043926bfd2 Merge branch 'master' into geometry-nodes-point-separate-node 2020-12-09 08:35:24 -06: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
ae4afcfbee Merge branch 'master' into geometry-nodes-point-separate-node 2020-12-08 11:27:16 -06: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
e0c199a527 Review feedback: Only move pointcloud, use numbers for naming 2020-12-07 11:56:00 -06:00
d6354a7ee2 Merge branch 'master' into geometry-nodes-point-separate-node 2020-12-07 11:15:41 -06: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
e7ec68cd46 Merge branch 'master' into geometry-nodes-point-separate-node 2020-12-07 08:01:00 -06: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
e902379764 Geometry Nodes: Attribute compare node
This node reads two input attributes as floats and allows for basic
element-wise comparison operations. Like the attribute math node,
it's also possible to switch to using floats as inputs. This node can
be combined with the point separate node for more flexibility on which
points to separate out.

I used the same abstractions that the attribute math node uses in this
commit, assuming that makes sense.
2020-12-03 22:50:45 -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
be3bb4da03 Geometry Nodes: Refactor and change point separate node
The threshold input is unecessary with an "attribute compare"
node before this one, or with attribute rounding. So to remove some
complexity it is removed, and a boolean input attribute is used instead.

For the implementation, the existing code becomes a bit more specific
to point cloud data, because I'm realizing that mesh separate is quite a
different problem, and it doesn't make sense to force the same code
to be able to solve that too.
2020-12-03 18:31:10 -06:00
6505f9c09a Geometry Nodes: Add boolean type to random attribute node 2020-12-03 18:27:20 -06:00
d9b8ddd883 Geometry Nodes: Add a boolean attribute data type 2020-12-03 18:23:21 -06: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
f58d9d7500 Merge branch 'master' into geometry-nodes-point-separate-node 2020-12-03 11:31:18 -06:00
920edc358c Merge branch 'geometry-nodes' into geometry-nodes-point-separate-node 2020-12-03 11:31:05 -06: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
390c4efa0c Merge branch 'master' into geometry-nodes 2020-12-02 16:58:44 +01: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
2f0f269684 Point Separate Node: Change has_attribute function 2020-12-02 09:08:33 -05: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
267ba329ec Point separate node: Refactor, add comments, clean up
Make more of the logic generic so that it can more easily work on more
component types in the future. Basically anything that handles attributes
can be generic.
2020-12-01 22:33:47 -05:00
bce42fbfe4 Attribute Access: Add a "has_attribute" method 2020-12-01 22:31:00 -05:00
59414e6a6f Point Separate Node: Revert earlier change to point cloud creation
I'm not quite sure creating the "radius" attribute in here is necessary
when any other attribute can be created later, but without this the
original radius attribute didn't pass to the new point cloud components
properly.

This should be investigated though, because the "radius" attribute
of pointclouds currently exists in some "semi-built-in" space that
doesn't really make sense.
2020-12-01 22:29:55 -05:00
4eef1d2edc Geometry Nodes: Point separate node
This node takes an input geometry and ouputs two geometries, moving
some points to the first and other points to the second depending on a
mask attribute input and a threshold.

The implementation tries to be "attribute component agnostic", meaning
it should be relatively easy to add "separate" functionality for more
component types in the future when they need to support it. (Then the
node could be renamed "Separate Geometry").

There is still an error carrying over the values for some attributes to
the output geometries.
2020-12-01 16:05:35 -05:00
1176591574 Codesign: Allo non-zero exit code for signtool on Windows 2020-12-01 17:16:48 +01:00
f14c9444c8 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-01 10:28:29 -05: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
399e5cc069 Geometry Nodes: support swapping inputs in function nodes
This is the same fix as in rB5ae666c2cc67be0e5ffb897c1ff48fe434d7dbc6.
2020-12-01 15:11:49 +01:00
5ae666c2cc 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-01 15:04:45 +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
b9525e3279 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-01 11:32:46 +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
1bb2c7dda3 Cleanup: Store "is_active" instead of pointer property in panel type
This is consistent with the way other panel type fields are stored.
2020-11-30 17:43:14 -05: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
a0f41a4fd1 Merge branch 'master' into geometry-nodes 2020-11-30 17:36:14 -05: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
7aa47cd6ff Merge remote-tracking branch 'origin/master' into geometry-nodes 2020-11-30 20:25:59 +01: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
1ecc2b305d Cleanup: add a comment 2020-11-30 16:43:08 +01:00
f7d9ec6a40 Merge branch 'master' into geometry-nodes 2020-11-30 16:34:16 +01:00
7c4c6809b9 Cleanup: correct function name 2020-11-30 16:33:37 +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
69f4088ba1 Geometry Nodes: Change modifier name
The modifier was called "Empty", which reflects the fact that the modifier
doesn't do anything when you add it. However, that is not true after you
change the modifier's node group, and the fact that the modifier uses
nodes is the one thing that distinguishes it at this point. This commit
changes the name to "Geometry Nodes", which is simple and consistent
with the "Geometry Node Editor" and the naming of the project so far.
2020-11-30 10:23:57 -05: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
eb9402996e Merge branch 'master' into geometry-nodes 2020-11-30 10:27:15 +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
a7680e2bcf Merge branch 'master' into geometry-nodes 2020-11-27 19:44:56 +01:00
bc3b48400d Geometry Nodes: do not create geometry depsgraph relation for empty object
This resulted in a warning.
2020-11-27 19:44:06 +01:00
659ef4938b 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-11-27 19:38:14 +01:00
683041fd48 Theme: Update shader node color to match socket color
Related to T82689

Reviewed by Brecht
2020-11-27 19:25:44 +01:00
39ee0a5484 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.

Related to T82689
2020-11-27 19:07:50 +01:00
45e2c12124 Geometry Nodes: Fix building in Mac 2020-11-27 19:06:19 +01:00
c19b363256 Geometry Nodes: Support exposing string sockets to the modifier
Create a string IDProperty in the modifier initialized with the socket's
default value.
2020-11-27 12:21:08 -05: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
abe38ee033 Geometry Nodes: fix when vertex group exists but there are no MDeformVerts yet
The `mesh->dvert` array is only allocated when needed. Just creating a new vertex
group without any vertices in it, does not trigger the allocation.
2020-11-26 22:52:16 +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
d40126d636 Geometry Nodes: Use ID template node group selector in the modifier
This puts the same controls as in the node editor header
in the modifier panel.
2020-11-26 12:49:09 -05:00
1bb864e40a Geometry Nodes: use attribute span api in Join Geometry node
Copying over attributes from the original geometries to the new
geometry only takes ca. a third of the time compared to before.
2020-11-26 18:37:39 +01:00
0d97c0dfa6 Geometry Nodes: use attribute span api in random attribute node
This results in a ~30% speedup. The execution time is bounded
by the random number generator here.
2020-11-26 18:22:21 +01:00
76d78c9212 Cleanup: correct comment 2020-11-26 18:20:46 +01:00
d1eec74c56 Geometry Nodes: use attribute span api in attribute math node
For a simple add operation, this results in a 3-4x speedup.
2020-11-26 18:12:31 +01:00
ac257864a6 Geometry Nodes: support accessing attributes with spans
Before, attributes could only be accessed via setter and getter functions.
While this works well, it can be cumbersome and slow.
It would be better if most code could just operate on the underlying
attribute array directly. The issue is that some attributes are currently
not stored in plain arrays (e.g. vertex positions, vertex groups, ...).

This patch implements a solution where these "special" attributes are
converted into a temporary array for easy access and then copied
back into their correct form after all modifications are done.

Attribute accessors now have a `get_span` and `apply_span` method,
which can be used exactly for that purpose. In the case of attributes
that are plain arrays internally, only small constant overhead is added.
2020-11-26 18:11:03 +01:00
6d0e92cf0a Geometry Nodes: protect object from instancing itself directly
This is not a perfect check, because it does not check instances recursivly.
However, it helps protect us from the most common mistake.
2020-11-26 18:03:10 +01: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
881e148cc5 Geometry Nodes: maintain some more data in the Join node
Material indices and smooth states are not destroyed anymore.
If the two incoming meshes use different materials, the materials of
the first input will be used. This is obviously not ideal, because the
second input might change its material.

In the future we want to handle that differently and keep both materials,
but for now this is consistent with the boolean node.
2020-11-26 15:33:59 +01:00
4a647ee188 Geometry Nodes: update normals after transforming mesh
This is not done in `BKE_mesh_transform`.
2020-11-26 13:46:50 +01: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
622b7fff15 Geometry Nodes: fix computing bounding box of evaluated point cloud
Currently, the bounding box does not include instances. This is consistent
with other object types.
2020-11-26 12:32:08 +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
6c241b2dd7 Geometry Nodes: Node editor header interaction with active modifier
This commit makes the way the selector in the middle of the node editor
header interacts with the active modifier much more intuitive.

 - With no active modifier, or when the active modifier is a non-node
   modifier, the "new" operator adds a new nodes modifier.
 - With an active node modifier, the drop-down affects the modifier's
   selected node group.
 - With no active object, there is no drop-down in the header.
 - The node editor's node group always updates, even when there is no
   active modifier.
 - Pinning disables the drop-down and keeps the same node group
   selected, regardless of the context.

This is designed to work similarly to materials and material slots,
which should be familiar to any Blender user. One workflow not allowed
by this design is editing any geometry node group, regardless of the
context, but if that turns out to be an issue it should be solved in a
similar way for all node editors.
2020-11-25 15:34:29 -05: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
c1b655c06a Geometry Nodes: Improve wording of modifier error messages
- Don't use contractions
- Remove unecessary words
2020-11-25 13:32:36 -05: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
b4f3c3cca0 Geometry Nodes: Use context for active modifier operators
This adds "modifier" as a new context variable in the property editor.
It is used instead of getting the active modifier directly. This way it
displays in the breadcrumbs panel, and the variable can be set only
in the modifier tab, meaning it won't work from the shortcut even
when the modifiers aren't visible.
2020-11-25 11:46:02 -05:00
e3f8ffc482 Cleanup: avoid very generic using-namespace statements 2020-11-25 16:47:09 +01:00
559999b2f5 Cleanup: minor changes 2020-11-25 16:17:58 +01: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
257725f829 Geometry Nodes: hide domain enum from random attribute node
While we can support different domains already in this node, there is not
really anything you could do with that data yet. It can be added back when
there is a use case for it.
2020-11-25 15:57:41 +01:00
b356288a75 Geometry Nodes: change builtin attribute names based on T82693 2020-11-25 15:55:29 +01:00
d344d25b7b Geometry Nodes: simplify Attribute Math node by using a new abstraction 2020-11-25 15:40:33 +01:00
8742bbd607 Nodes: simplify Math code by using new abstraction layer 2020-11-25 15:39:42 +01:00
3576e669cb Nodes: initial abstraction to simplify math node implementations
Currently, implementing a node that supports math operations requires
you to write a long switch statement. The goal of this abstraction
is to reduce the number of these switch statements.

Note, this commit adds new such long switch cases. However, in the upcoming
commits existing math nodes are updated to use this abstraction, resulting in
less code overall.
2020-11-25 15:38:08 +01:00
044def82b9 Geometry Nodes: add utility method to create a dummy attribute reader
This can be used when instead of an actual attribute, a constant value
should be used.
2020-11-25 15:31:56 +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
92d12741a5 Merge branch 'master' into geometry-nodes 2020-11-25 12:27:44 +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
41a74159c3 Geometry Nodes: Fix missing node editor redraw for active modifier
When the active modifier changes, or when its node group changes, the
node editor should redraw, because these actions change its context.
2020-11-24 17:38:53 -05:00
8a2b329a21 Geometry Nodes: Always use the active modifier for shortcuts
Based on discussion with the team, summarized in T82691, it makes sense
to simplify the shortcut behavior and remove the way the shortcuts
currently activate on hover if there is no active modifier. This commit
also removes the behavior of clearing the active modifier when you
click on blank space in the modifier tab.
2020-11-24 16:57:45 -05:00
268508d2b0 Geometry Nodes: Make next modifier active when deleting
Previously it was the previous modifier, but this change keeps the index
of the object's active modifier consistent when deleting a modifier.
2020-11-24 13:52:20 -05:00
ce08a2bd48 Merge: fix after merge
This was part of rBe922dd7d8a307c54d49bc01649a12610b022192b.
2020-11-24 18:12:47 +01:00
7585f55a4c Merge branch 'master' into geometry-nodes 2020-11-24 18:05:31 +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
49f1c8ebec Geometry Nodes: remove attribute name inputs from Instancer node
The node now assumes that the data is found in the
"Position", "Rotation" and "Scale" attribute.
Those names might change soon.
2020-11-24 14:30:37 +01:00
9831362243 Geometry Nodes: rename Join to Join Geometry 2020-11-24 14:21:54 +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
710842cd1d Geometry Nodes: only output new data from Distribute and Instance nodes
This can be recombined with the original data using a
Join node if necessary.
2020-11-24 11:50:49 +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
433fcbec1a Cleanup: clang tidy 2020-11-24 11:42:57 +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
ef1ee262ad Fix Compilation Error
GCC showed this as a warning, MSVC as an error.
2020-11-24 08:45:32 +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
72386c64ef UI: Improvements to interaction with active modifier
This commit includes these improvements to operators and how they
relate to the active modifier:

 - Shortcuts performed while there is an active modifier will affect
   only that modifier.
 - Clicking anywhere on the empty space in a modifier's panel will make
   it active.
 - Clicking anywhere in the empty properties space will clear the
   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 neeeds a small tweak so that this "click in panel"
event can be handled afterwards.
2020-11-23 22:38:12 -05: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
e68e897077 Cleanup: Correct node name in definition function 2020-11-23 18:32:36 -05:00
52c6d36e4e Geometry Nodes: Initial implementation for attribute math node
This provide a simple implementation for basic math operations. Add,
subtract, multiple, and divide are implemented so far. Domain
interpolation is not implemented yet either.

This commit also adds two "Type" options to the node for choosing
explicitly whether to use an attribute or a float value as one of the
inputs. It is not possible to use two floats as inputs, because that
would be a regular math node.

Some cleanup to avoid some code duplication will come in a future
commit.
2020-11-23 17:01:53 -05:00
75a92d451e Geometry Nodes: new Join node
This node creates a new geometry based on two incoming geometries.
In the future the node ui can be extended to support more than two inputs.

The output geometry will have all the attributes of the inputs.
If both inputs have non-matching set of attributes, missing data is either
interpolated, type cast or zeroed.

Ref T82786.
2020-11-23 19:13:25 +01:00
d84bf961f8 Geometry Nodes: improve geometry component
* It now knows its own component type.
* Add virtual method to check if the component is empty.
* Add virtual methods to find all attribute names.
* Support adding existing components to a geometry set.
2020-11-23 19:05:27 +01:00
02d61faab0 Geometry Nodes: disable random attribute node when name is empty 2020-11-23 19:02:44 +01:00
7f4eb529c4 Geometry Nodes: duplicate referenced data layers in attribute api 2020-11-23 16:47:11 +01: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
18e768c78e Cleanup: improve naming convention for geometry node exec functions 2020-11-23 12:03:29 +01:00
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
26c7be27b7 Geometry Nodes: Add boilerplate code for attribute math node
This code doesn't actually do anything, but it provides a base for an
 implementation and exposes the the necessary interface to the UI.
2020-11-22 22:17:08 -05:00
e72b235fce Cleanup: Doxygen section formatting
Generally doxygen headers are title case and are styled like prose
rather than code.
2020-11-22 20:55:31 -05:00
8aea0e8ac2 Merge branch 'master' into geometry-nodes 2020-11-22 15:01:42 -05: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
2ce1b89d75 Merge branch 'master' into geometry-nodes 2020-11-20 16:01:32 -05:00
0649131be7 Geometry Nodes: Switch boolean node inputs
This changes the meaning of the order of the two geometry input sockets
to match the existing boolean modifier. The first socket is now the base
mesh and the second socket is the "cutter" geometry.
2020-11-20 15:20:03 -05:00
1bebd12eaf Cleanup: Use nullptr instead of NULL in C++ code 2020-11-20 15:10:51 -05:00
797c8f6d75 Geomtetry Nodes: Set node editor context from the active modifier
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.

There are still missing updates when switching the modifier's node group.
2020-11-20 14:29:52 -05:00
1a67617631 Geometry Nodes: Expose the active modifier to the UI
This exposes the operator to set the active modifier as the type icon
in the header of the modifier panels. Tweaks to the widget drawing
code were necessary to use the red alert for non-emboss operator
buttons. Then, the panel for the active modifier gets a border around it
(which currently uses the property search theme color), requiring
an "active property" field in the PanelType struct.
2020-11-20 14:22:08 -05:00
c2359ff4aa Geometry Nodes: improve boolean node when not both inputs are connected
Previously, it was always outputting an empty geometry in that case.
This was confusing because e.g. the output of a union operation
with a single non-empty mesh is also non-empty.
2020-11-20 19:02:01 +01:00
763ebc3156 Geometry Nodes: use attribute name inputs in point instance node
This will probably not stay exactly like this, because it looks a bit ugly.
Adding this now, because it increases flexibility a lot and allows me
to test the attribute api a bit more.
2020-11-20 18:47:55 +01:00
f7d9bfafd9 Geometry Nodes: combine Vertex and Point domains
Originally, there were technical reasons for why two different domains
were used. Those reasons have been lost unfortunately, and there
don't seem to be any issues with combining the domains now.

This reduces confusion when users have to select the domain type
in enums.
2020-11-20 18:23:07 +01:00
088e6a5282 Geometry Nodes: initial support for implicitly type casting attributes
Those allows e.g. float attributes to be accessed as if they were vector attributes.
2020-11-20 18:10:24 +01: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
9798d68cc1 Geometry Nodes: simplify point instancer node 2020-11-20 17:45:12 +01:00
323335f076 Geometry Nodes: iterate on attributes api and improve random attribute node
Attributes can now be accessed through a GeometryComponent.
MeshComponent and PointCloudComponent implement the specific
attribute access mechanisms using virtual methods.

This simplifies code that should work on different geometry components
quite a bit, because it only has to be written once without using templates.
The Random Attribute node benefits from that a lot.
2020-11-20 17:35:45 +01:00
70d493e5ee Geometry Nodes: allow getting inputs without removing them
This is useful when one wants to get an input value multiple times.
2020-11-20 17:31:46 +01:00
87366baaed Functions: support lookup without extract in generic value map 2020-11-20 17:29:52 +01:00
8e1d7d9e8c BLI: add missing const 2020-11-20 17:29:21 +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
Léo Depoix
baa79dc805 Geometry Nodes: Add "Edge Angle" option to edge split node
Although disabling this option is equivalent to setting the edge angle
to 180 degrees, there is no great reason to change the settings from what
is exposed in the modifier.

Differential Revision: https://developer.blender.org/D9564
2020-11-20 09:45:45 -05:00
3736a7cadd Geometry Nodes: Add ability to clear object's active modifier
`object.modifiers.active = None` will just clear the active flag
from every modifier.
2020-11-20 09:32:46 -05:00
66ea03e908 Geometry Nodes: Add object.modifiers.active to RNA
This is a RNA only pointer property used to set and get the active
modifier without using an operator.
2020-11-20 09:25:01 -05:00
2781e51cda Fix T82762: linked but unavailable output handled incorrectly 2020-11-20 12:06:26 +01:00
1f2ce121a3 Fix T82773: node with unavailable output is handled incorrectly 2020-11-20 11:50:13 +01: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
9524019d58 Geometry Nodes: Rename category Scattering to Point and sort
The Geometry category should come before Input.
2020-11-20 00:05:13 +01: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
61e0f22945 Geometry Nodes: Hide unsupported attribute types and domains
The random attribute node currently doesn't support every attribute
domain or data type. With a bit of boilerplate code we can remove these
unsupported enum items from the UI for now, and also get a system to
remove unsupported items from the UI in the future. If all attribute
creation nodes end up always supporting all attibute types and domains,
this can be removed.
2020-11-19 17:13:56 -05:00
b7d7051dc3 Geometry Nodes: Add an operator to set the active modifer
Also make new modifiers active, and properly set the active
state when duplicating a modifier.
2020-11-19 14:47:43 -05:00
e0516d4d8e Geometry Nodes: Disallow editing and animating modifier active property
There will be an operator to access this property instead, which provides
a better name and tooltip to expose in the UI, and makes it more clear
that the property is dependent on the other modifiers.
2020-11-19 14:44:20 -05:00
097e1ca1a1 Geometry Nodes: Add the concept of an active modifier
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.
2020-11-19 14:35:48 -05: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
dc628e7c38 Cleanup: use struct instead of class 2020-11-19 17:41:40 +01:00
bb960c85a5 Merge branch 'master' into geometry-nodes 2020-11-19 17:38:48 +01:00
eb25446b9d Geometry Nodes: Categories for the nodes
See T82367. There is some ongoing discussion about Attributes vs
Attribute. But it is settle to Attribute, so it matches Color, Vector
and Geometry.
2020-11-19 17:21:39 +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
0c7df205a5 Geometry Nodes: T82701 Name for initial Node Groups
Rename it from "Geometry Node Group" to "Geometry Nodes". This is
shorter and equality descriptive.
2020-11-19 16:59:51 +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
0f1fe96e0b Geometry Nodes - Internal rename + API change: NODES for anything but UI
Most of the times the nodes will be non-empty. Empty is really only what
shows in the UI.
2020-11-19 16:11:24 +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
417924d840 Geometry Nodes: transform geometry in Object Info node 2020-11-19 13:40:38 +01:00
a581367a2b Geometry Nodes: give nodes access to object that is being modified 2020-11-19 13:38:39 +01:00
00928f7826 Geometry Nodes: simplify attributes api and support deletion
The main difference is that the functions to access attributes have
been moved to MeshComponent and PointCloudComponent.
2020-11-19 13:17:11 +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
91971093bb Geometry Nodes: support controlling instance scale in point instancer node 2020-11-18 13:41:08 +01:00
96beb711e3 Geometry Nodes: support point cloud component in random attribute node 2020-11-18 13:40:28 +01:00
7e930f4e8b Geometry Nodes: support rotation and scale in instances component 2020-11-18 13:39:56 +01:00
aa780a4c17 Geometry Nodes: fix memory leak 2020-11-18 13:27:36 +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
5c3496f3cd Geometry Nodes: initial Random Attribute node
This adds some ui boilerplate code for the Random Attribute node and
provides an initial implementation.

Note, while the implementation can already randomize attributes, it might
not behave as expected under all circumstances yet. It's still work in progress.
2020-11-18 12:28:57 +01:00
425b15e23f Geometry Nodes: use attribute api in point instance node 2020-11-18 12:25:47 +01:00
5c2730f64d Geometry Nodes: use attribute api in point distribute node 2020-11-18 12:25:17 +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
866a56f76e Geometry Nodes: initial generic attribute access API
I will have to do a couple more iterations on this api in the upcoming weeks,
but for now it should be good enough.

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

Accessing attributes through this indirection does have a performance penalty.
In later iterations of this API I want to reduce this penalty and extend the API
so that performance critical code does not have to go through the indirection
for every attribute access.

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.
2020-11-18 12:20:54 +01:00
63a286e4ce Functions: add float2 cpp type 2020-11-18 12:00:45 +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
15c6390960 Merge remote-tracking branch 'origin/master' into geometry-nodes 2020-11-18 02:03:02 +01:00
083cde0b43 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-11-18 02:02:32 +01:00
0783a9a194 Cleanup: Remove all of "#ifdef WITH_POINT_CLOUD"
Since Point Cloud was removed from experimental this is no longer needed.
2020-11-18 02:02:32 +01:00
b05f841c3a 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-11-18 02:02:32 +01:00
4db4177587 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-11-18 00:31:23 +01:00
c0f3d31998 Remove Geometry Nodes Editor from experimental
As part of preparing this work for master, with an initial subset of
working functionalities the Geometry Nodes Editor can be exposed for
everyone.

(it also helps people that are testing the branch)
2020-11-18 00:30:23 +01: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
b26cbb5d53 Merge branch 'master' into geometry-nodes 2020-11-16 12:03:01 -05: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
52e3608fe9 Geometry Nodes: simplify GeometrySet ownership handling
Previously, GeometrySets and GeometryComponents has reference
counters and could be shared. This commit changes it so that
only GeometryComponents are shared. A GeometrySet is a fairly
small type that is cheap to copy.

A lot of code simplifies when we can assume that GeometrySet
is cheap to copy.
2020-11-16 13:48:33 +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
6ba6e97407 Geometry Nodes: Move GeometrySet classes to global namespace
Brecht and I decided to move the GeometrySet classes
to the global namespace for now. This way we can use
the same type in C and C++ and don't have to use
reinterpret_cast as often.
2020-11-16 12:07:51 +01:00
af013ff76f Cleanup: clang-tidy 2020-11-16 21:54:28 +11:00
4913b624d8 Merge branch 'master' into geometry-nodes 2020-11-16 11:49:14 +01: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
96ce1e9a95 Geometry Nodes: Improve node group output modifier error
More than output for the modifier's node group is fine, because the
node group may be used in other situations, but the modifier will
not work if there is no geometry output socket.
2020-11-14 20:09:27 -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
a3efa1d798 Merge branch 'master' into geometry-nodes 2020-11-14 15:17:46 -05: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
e50553c61a Empty Modifier: Fix build and put in the right order
Bypassing the macro that creates modifiers to allow the enum to be
referring to the Empty modifier, but the internal struct in the code to
be Nodes.

Also fix the name of the new created modifiers to be "Empty".

Fix was built with rBb458ea6b23381a9acb90dbbd73ced678e1d404c5.
2020-11-14 01:51:06 +01:00
b458ea6b23 Rename: "Nodes" modifier to "Empty" (take 2)
Leave the internal DNA data struct as "Nodes", and only rename the
modifier and user interface to Empty.

See 4a2734a835 for the original take and the reasoning
for renaming from Nodes to Empty.
2020-11-13 23:29:09 +01:00
056d7bb175 Revert "Rename: "Nodes" modifier to "Empty""
This reverts commit 4a2734a835.

Reverting this so that all we change is the UI name, not the DNA struct
and the internal variable names.
2020-11-13 23:19:40 +01:00
2abbcaa021 GPencil: Fix compiler warning, unused variable 2020-11-13 22:31:58 +01:00
Léo Depoix
9769cf1ee6 Geometry Nodes : Removing "Combine Strings" and Group Instance ID from UI
This diff remove "Combine Strings" and "Group Instance ID" nodes from the UI (but keep them in the source code to be able to bring them back if needed).

This is part of "Cleanup 1st Sprint Nodes" (https://developer.blender.org/T82370).

Differential Revision: https://developer.blender.org/D9558
2020-11-13 22:23:37 +01:00
4a2734a835 Rename: "Nodes" modifier to "Empty"
This introduces a regression. Users need to re-create their modifiers
and set their values again. The NodeGroups are intact so all they need
is to create new "Empty" modifiers and set the node group.

---

Original problem: Eventually most modifiers will be node-based, so naming
this new modifier "Nodes" will get outdated pretty quickly.

Calling it "Empty" it's fairly descriptive, since the node tree simply connects
the modifier Input to an Output, without any effect.

There is a potential problem, that it could be associated with the
Empty object type. Like some sort of Hook.

This is the task T82700, and the design task T82537.
2020-11-13 22:16:28 +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
1ddd717803 Geometry Nodes: Improve error messages for property mismatches
Related to T82438. This adds some basic checks for common errors and
currently unsupported socket types in the modifier.
2020-11-13 12:35:10 -05:00
0066e59f2d Merge branch 'master' into geometry-nodes 2020-11-13 11:54:29 -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
ec7fffb033 Cleanup: Remove unused variable 2020-11-12 20:38:51 -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
956cf9a48d Cleanup: Clang Tidy 2020-11-12 16:06:12 -05:00
c27095b5cb Cleanup: Spelling
Also move some input extraction after the special case check.
2020-11-12 16:04:45 -05:00
Léo Depoix
8ef8cb7e34 Geometry Nodes: Add method enums to mesh triangulate node
This commit adds the remaining "method" enums from the triangulate modifier.

Differential Revision: https://developer.blender.org/D9502
2020-11-12 15:49:59 -05:00
0f6bee8e54 Merge branch 'master' into geometry-nodes 2020-11-12 15:19:09 -05:00
3093f89498 Geometry Nodes: Add null check for modifier property UI functions
An ID IDProperty exposed to the modifier  (object, material, etc) does not
have min, max, etc. values, so they should not be required.
2020-11-12 14:47:17 -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
f211030344 Cleanup: Fix typo 2020-11-12 12:19:44 -05: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
b277025d8e Geometry Nodes: Add modifier disabled check 2020-11-12 12:16:32 -05: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
94572a4e30 Geometry Nodes: use density attribute name instead of index as node input
This implements a workaround for the issue that (for historical reasons)
the names of vertex groups are stored on the object while the actual vertex
group data is stored on the mesh.

The solution is to copy the vertex group names from the object into
the `MeshComponent` so that the information is not lost, when the
object cannot be accessed.
2020-11-12 16:58:30 +01:00
bc2230df71 Geometry Nodes: cleanup geometry node interface
Previously, the execution function of a geometry node has three parameters.
Now it has only one. This makes it easier to pass more information to the
execution function, that might only be used by a few nodes, because we
don't have to add more parameters that are unused in most cases.
2020-11-12 16:31:32 +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
caa942b033 Geometry Nodes: actually create instances in Point Instance node 2020-11-12 13:28:33 +01:00
5dff952b67 Geometry Nodes: support instances in Transform node 2020-11-12 13:27:56 +01:00
5877e34eb4 Geometry Nodes: new DupliGenerator for instances component
With this, instances generated in a node tree can be rendered.
2020-11-12 13:27:20 +01:00
770bcfac9b Geometry Nodes: improve point distribute node
* Support vertex weights to control density.
* O(n) performance instead of O(n^2).
* More stable when density weights are changed.

The vertex group has to be specified using an index for now.
This is a technical limitation that will resolved a bit later.
2020-11-12 13:24:46 +01:00
b081108819 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, those 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.
2020-11-12 13:20:23 +01:00
2be7b2aaf9 Geometry Nodes: better handle link cycles 2020-11-12 12:58:27 +01:00
912b38001f Geometry Nodes: use GeometrySet when evaluating pointcloud modifiers
This changes the signature of the modifyPointCloud function.
I'm doing that instead of making a new callback, because it requires
changes to significantly fewer files. Eventually it would be good
combine modifyMesh, modifyHair, modifyPointCloud and modifyVolume
into one modifyGeometrySet.

I temporarily disabled the displacement only modifiers for point clouds.
Support can be added back a bit later. I assume those have not been
used anywhere anyway.

The output of point cloud modifiers can not only be another point cloud,
but also a mesh and/or some instances. I added a new geometry_set_eval
field to Object_Runtime. For point cloud objects, the final geometry is
now referenced by that pointer instead of data_eval. The data_eval field
is still initialized after modifier evaluation to make some other code happy.

The evaluated geometry set is not yet passed to the renderer, so a point
cloud is currently rendered empty.
2020-11-12 12:57:52 +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
c4352f44bc Geometry Nodes: initial Object Info node
This node takes an object as input and outputs its location, rotation,
scale and geometry. Right now the loc/rot/scale are extracted from the
objects `obmat`. The geometry is just the mesh in the local space of the
source object.

We will likely need some more control over space transformations
using enums in the node, but those can be added a bit later.
2020-11-12 12:24:07 +01:00
0feca5f07d Geometry Nodes: initial object socket support
The fundamental difference between object sockets and the
other existing data sockets is that an object is an ID data block.
Changing the value of an object socket also changes the depsgraph.

The modifier has to analyse the node tree to figure out which other
objects it depends on. Currently, this is done very simply by just
looping over all sockets and collecting the objects. In the future
this can be improved by also figuring out what components of
an object are needed.

Instead of passing object pointers around in the node tree, we actually
use a handle. This handle is just a number internally that identifies
a specific object. The conversion between handles and object pointers
is done using a map that is provided by the modifier.

This approach has a couple of benefits. It protects us a bit from passing
around pointers that are not known to the modifier and therefore are
not in the depsgraph. Furthermore, the object pointer can change
while the handle stays the same. This is not important right now, but
is not unlikely to become useful in the future.

The API for how nodes access object pointers is not ideal yet and
will be improved in the future.
2020-11-12 12:20:59 +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
2984fb2b49 Geometry Nodes: crash when using Vector Math node 2020-11-12 11:51:12 +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
9e6553c0d4 Geometry Nodes: change color of object socket 2020-11-12 11:50:23 +01:00
107a0894cc Geometry Nodes: improve GeometrySet
This commits implements multiple changes:
* Adds a simple C API.
* Improves the ownership handling by introducing GeometryOwnershipType.
* Adds an InstancesComponent that stores positions and Object pointers.
2020-11-12 11:47:48 +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
8ecc1bea4c Nodes: add utility to check for link cycles in derived node trees 2020-11-12 11:35:46 +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
91ad33ef8f Merge branch 'master' into geometry-nodes 2020-11-12 11:25:25 +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
fa5190e742 fix after merge 2020-11-09 15:55:24 +01:00
74ed591f62 Merge branch 'master' into geometry-nodes 2020-11-09 15:48:18 +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
3d5efb4335 Geometry Nodes: rename Geometry type to GeometrySet
This should not change any functionality.

After talking to Brecht, we agreed that it might be good
not to have a class called Geometry for now. In the future
we might want to use a Geometry class as base class for
meshes, curves, etc.

This commit renames the Geometry class to GeometrySet,
because it is essentially a container that can contain
multiple geometries of different types.
2020-11-09 13:08:17 +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
Léo Depoix
140b7cfe0d Geometry Nodes: cleanup Subdivision Surface node inputs
Ref T82370.

Differential Revision: https://developer.blender.org/D9487
2020-11-09 12:49:33 +01:00
af7cc3f8bb Fix merge issues 2020-11-09 12:46:04 +01:00
d2c4af9865 Merge branch 'master' into geometry-nodes 2020-11-09 12:44:45 +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
e5c637f5fe Merge remote-tracking branch 'origin/master' into geometry-nodes 2020-11-06 18:22:36 +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
11d12d543d Fix build error on windows: Don't use designated initializers in C++ 2020-11-02 08:20:54 -06:00
2c6114b238 Merge branch 'master' into geometry-nodes 2020-11-02 08:15:15 -06: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
152bd43ae1 Merge branch 'master' into geometry-nodes 2020-11-02 11:44:46 +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
45012c3309 Geometry Nodes: Fix property values reset when input socket is added
The names of the IDProperties are the socket identifiers, not their names.
2020-10-31 23:24:06 -05:00
5177c35498 Merge branch 'master' into geometry-nodes 2020-10-31 22:58:39 -05: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
49c8042f29 Merge branch 'master' into geometry-nodes 2020-10-31 14:21:14 +01:00
64faa59846 Cycles: Fix debug compilation after tile stealing commit 2020-10-31 14:04:30 +01:00
Léo Depoix
f8c52590c0 Geometry Nodes: new Subdivision Surface node
This node is similar to the subdivision surface modifier. It subdivides
the mesh component of a geometry. The options have the same meaning
as in the modifier.

Differential Revision: https://developer.blender.org/D9364
2020-10-31 10:51:09 +01:00
0b897e0308 Merge branch 'master' into geometry-nodes 2020-10-31 10:43:52 +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
c34438dd78 Geometry Nodes: Rename node category based on functionality
Naming based on supported geometry components only works in some cases.
For nodes that work with multiple data types, it's better to categorize
them based on their functionality.
2020-10-31 00:37:04 -05:00
e0a4dc9396 Merge branch 'master' into geometry-nodes 2020-10-31 00:30:10 -05: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
51fa44522f Geometry Nodes: Add errors for out of sync sockets and properties
Theoretically the modifier's properties could be changed or removed by
Python, so it may be useful to have errors printed and added to the
modifier in that case.

I kept the check as a separate step from the `compute_geometry`
pass because the object is needed to set the modifier error message.
But it could easily be moved there in the future.
2020-10-30 11:42:11 -05: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
343e13f464 Geometry Nodes: change geometry socket color
Ref T81848.
2020-10-30 17:29:36 +01:00
1103809fab Merge branch 'master' into geometry-nodes 2020-10-30 16:40: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
5b89d49b0d Geometry Nodes: Allow node group inputs with the same name
If we add the "name" label manually with uiItemR, we can use the socket
identifier instead of the name for the IDProperty name. This will also
allow us more flexibility in how to draw the settings in the future, and
removes the empty _RNA_UI proprety that was drawn before.
2020-10-30 09:57:54 -05: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
e805bfc768 Cleanup: Return early in edge split node 2020-10-29 15:53:32 -05:00
67cb4fdbdc Cleanup: Don't use unsupported struct initialization
Although this worked for me, it appears this isn't supported until C++20.
2020-10-29 15:48:38 -05: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
8ed74c9daf Geometry Nodes: Use UI settings for properties in modifier
The system for exposing property settings like min, max, default, subtype,
etc. for ID properties is quite convoluted currently, so I won't give a
full description here, but this commit creates the tree of ID properties
needed to store that information. This means that property subtypes like
"angle" or "XYZ" will affect the display in the modifier.

Limitations:
 - The _RNA_UI property is displayed in the modifier. This may require a
   modification to uiDefAutoButsRNA to fix.
 - IDProperties must have unique names, but node sockets don't have
   that limitation. This can be solved by adding a "UI name" field to
   IDProperties.
2020-10-29 14:11:32 -05: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
d7cb25e028 Fixup for cmake header cleanup
Issue introduced on f73a420e5a.
2020-10-29 18:27:31 +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
e3395093ff Geometry Nodes: Create the node group when adding a new Nodes modifier 2020-10-29 17:36:16 +01:00
f73a420e5a Cleanup: Nodes Modifier header to its proper location 2020-10-29 17:36:16 +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
b8b240b329 Geometry Nodes: do not reference custom data layers when copying mesh
We can't use that for now, because the original mesh might be freed
before the new copied mesh. When the original mesh is freed, the shared
layers will be freed as well.

This can probably be improved in the future, so that we can actually
share attribute arrays between meshes. An approach similar to how
geometries and components are shared should work as well.
2020-10-29 15:47:19 +01:00
ae2827bb52 Geometry Nodes: add comment mentioning that custom data might be shared 2020-10-29 15:42:01 +01:00
bb97284f8a Geometry Nodes: refactor Geometry type
A geometry now contains zero or more geometry components.
A geometry component is a subclass off GeometryComponent.
Currently, there is a MeshComponent and PointCloudComponent.

A geometry contains at most one component of each type.
Individual components can be shared between multiple geometries
to avoid unnecessary copies. For that, each component has a user
count that determines when the component will be freed and whether
it is mutable.

Code working with geometries can either work with the components
directly, or use the utility functions on the geometry that cover the
most common operations.

In the future, additional component types can be added. For example,
we'll probably need components for curves and volumes.
Furthermore, something like an InstancesComponent can be added,
which contains points with attributes and references a geometry/object/collection
that is instanced on all the points.
2020-10-29 15:38:15 +01:00
209e82da45 Merge branch 'master' into geometry-nodes 2020-10-29 15:22:59 +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
e63d43e6b9 Merge branch 'master' into geometry-nodes 2020-10-29 11:31:55 +01: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
802ba35654 Geometry Nodes: make default group output node active
Otherwise some updates were missing when sockets are changed.
2020-10-28 20:27:57 +01:00
79c9c11b35 Merge branch 'master' into geometry-nodes 2020-10-28 20:21:52 +01: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
e1d0ab2dbc Geometry Nodes: fix missing update when inserting a node between two nodes 2020-10-28 14:53:06 +01:00
687f994251 Geometry Nodes: improve api for nodes
The execute callback of a geometry node gets more domain specific
types as parameters now: GeoNodeInputs and GeoNodeOutputs.

Those types are also aware of what node is being executed and can
provide better error messages when they are used incorrectly.
2020-10-28 14:05:07 +01:00
5c7767e0e0 Merge branch 'master' into geometry-nodes 2020-10-28 14:01:05 +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
af9ee8e2bc Merge branch 'master' into geometry-nodes 2020-10-28 10:40:35 +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
562f2e604a Merge branch 'master' into geometry-nodes 2020-10-27 21:21:03 -05: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
84e81b8cc3 Merge branch 'master' into geometry-nodes 2020-10-27 14:01:48 -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
5ae9527770 Geometry Nodes: Support pointcloud in transform node
This is likely not the final implementation of the transform node, but
it's  a good trivial case for supporting multiple geometry data types.
2020-10-27 12:59:58 -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
082c17a2d2 Fix group input is resetting in modifier 2020-10-27 17:01:03 +01:00
09677d737c Fix missing null check in recent commit 2020-10-27 15:53:17 +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
bec7248178 Cleanup: Use proper C++ types 2020-10-27 09:43:38 -05:00
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
0103cb2051 Geometry Nodes: initial support for bool group inputs
Still need to work on the uilayout inside the modifier.
2020-10-27 14:59:26 +01:00
9f38ebefcb Geometry Nodes: support vector inputs to geometry group 2020-10-27 14:54:41 +01:00
8f934852f0 Geometry Nodes: initial support for displaying group inputs in modifier
This uses the previously added id properties on the nodes modifier
to store values that are passed into the geometry node group.
2020-10-27 13:44:46 +01:00
cb16db7803 Geometry Nodes: enable nodes modifier in edit mode 2020-10-27 12:09:13 +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
f8965f12a1 Geometry Nodes: Fix memory leak 2020-10-26 23:15:05 -05:00
7f2a20f89b Merge branch 'master' into geometry-nodes 2020-10-26 23:12:45 -05:00
4d15f4ac5b Cleanup: Use const for PointCloud variable 2020-10-26 23:12:22 -05:00
5566818603 Geometry Nodes: Add initial scattering nodes
The first is a "Point Distribute" node, which takes a mesh and outputs a
pointcloud, scattering points randomly on the surface based on the input
density. The distribution algorithm is extremely basic at this point, and
doesn't take into account an attribute weight at each vertex.

The second node is a "Point Instance" node, which is mainly a placeholder
until the engineering design for how to work with instancing in geometry
nodes is decided. For now it just runs the same code that the convert
pointcloud to mesh operator uses.
2020-10-26 23:00:31 -05:00
9a06c6a040 Geometry Nodes: Add function to create a temporary pointcloud
We needed a "nomain" funciton similar to the one we have for meshes in
order to add a working pointcloud for the geometry nodes.
2020-10-26 22:54:55 -05:00
e097116072 Geometry Nodes: Add utility to position point randomly on 3D triangle 2020-10-26 22:44:35 -05:00
b844caca6d Geometry Nodes: Add pointcloud support to geometry class
This adds another set of the same mesh functions but for pointclouds.
There are probably better ways to generalize this functionality, but that
may have to be rethought in the future anyway if we want to store
multiple of each type. And anyway it's handy to have a specific set of
"pointcloud" functions available in the node implementations.
2020-10-26 22:41:57 -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
046ac5fccd Geometry Nodes: Initial mesh boolean node
This uses the code from the rewritten boolean modifier from 2.91 as a node.
The implementation is about as minimal as it can get, since for now the use
case of this node is mostly to test multiple geometry outputs and inputs.

The boolean code requires a BMesh, so the node converts the input meshes
to BMesh, so the bmesh is added as a dependency to the nodes module.
2020-10-26 14:27:19 -05: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
ef4fbba596 Cleanup: remove unused modifier property 2020-10-26 18:27:44 +01:00
aa8360d0fa Geometry Nodes: initial test trying to use id properties to initialize group inputs
The settings can only be set via Python currently. The matching between properties
and group inputs is based on the socket identifier (which is e.g. `Input_5`).
Maybe we'll have to use a different matching strategy in the future, will see.
2020-10-26 18:23:51 +01:00
76c356c12e Geometry Nodes: store id properties in nodes modifier
The properties are not used yet, but can already be accessed with Python
using `modifier.settings['setting name']`.

The plan is to use id properties to store the parameters that the modifier
passes into the geometry node group.
2020-10-26 17:53:51 +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
e04491073d Geometry Nodes: support evaluation with more than one group input
Group inputs are not yet exposed in the modifier. For now I just added
a simple float setting that will be passed to every float input of the group.
Inputs of other types have some default value.
2020-10-26 14:16:26 +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
a5dda5996e Geometry Nodes: connect group input and output by default 2020-10-26 13:29:03 +01:00
c48e4b7a44 Geometry Nodes: improve node tree evaluation
This change reduces the number of unnecessary copies of data
and avoids computing the same value more than once.
2020-10-26 13:27:02 +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
4ae2d6206a Geometry Nodes: initial Transform node
Most of this code has been written by @HooglyBoogly.
I just changed the exec funtion so that it does not have to make
a copy of the mesh.
2020-10-26 12:27:51 +01:00
47f5a635da Geometry Nodes: add utility method to check if a geometry has a mesh 2020-10-26 12:25:46 +01:00
eb8574bc8b Merge branch 'master' into geometry-nodes 2020-10-26 12:10:12 +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
bc4e31afb6 Merge branch 'master' into geometry-nodes 2020-10-24 14:38:00 +02: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
9d7672be71 Merge branch 'master' into geometry-nodes 2020-10-23 15:18:20 +02:00
994e7178bb Geometry Nodes: make some function nodes available
We might not want to have all those nodes in a final version.
Some of them have been added with particle nodes in mind.
However, to test the evaluation system it is useful to have a
couple of nodes available.

Those nodes should "just" work, because their implementation
is reused from the particle nodes project.
2020-10-23 15:13:19 +02:00
1719743066 Geometry Nodes: improve node group evaluation
This adds support for nodes that have a multi-function implementation.
That includes various function nodes like Math, Combine Vector, ...

Furthermore, there is support for implicit conversions now. So it should
work when one connects e.g. a float to an integer and vice versa.
2020-10-23 15:09:55 +02:00
8910033f57 Nodes: add utility methods 2020-10-23 15:05:01 +02:00
2a4c6c612a Functions: add utility method 2020-10-23 15:01:07 +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
b062b922f9 Geometry Nodes: Resolve some missing 3D viewport updates
These two functions "snode_notify" and "ED_node_tag_update_id" appear to
be mostly duplicates. However, there is already a case for each type of
built-in node tree, so it makes sense to add one for the geometry node
tree as well. This doesn't solve the update issues for changing number
in buttons, that must be handled somewhere else.
2020-10-22 22:59:40 -05: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
895f4620a0 Merge branch 'master' into geometry-nodes 2020-10-22 22:03:28 -05: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
fafed6234b Geometry Nodes: Add edge split node functionality 2020-10-22 13:48:56 -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
7ff8094a8b Geometry Nodes: expose minimum vertices input of Triangulate node 2020-10-22 18:24:05 +02:00
5aabf67a9c Fix error in previous commit
That should not have happened -.-
2020-10-22 18:23:39 +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
ab8c7fe946 Fix previous comment 2020-10-22 18:20:17 +02:00
a05012d500 Geometry Nodes: simplify and deduplicate callbacks on sockets
This adds a layer of abstraction between the code calling callbacks
on sockets and the implementation of those callbacks.
This abstraction layer allows some sockets to not implement all
callbacks when those can be derived from some other callback.
2020-10-22 18:08:27 +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
97a93566e9 Geometry Nodes: change "Node Tree" to "Node Group" 2020-10-22 15:52:15 +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
da4d697772 Geometry Nodes: initial support for evaluating geometry node groups
This is still very basic and does quite a few unnecessary computations.
Also the error handling is quite weak currently, so when invalid things are
connected, it will probably just crash.

Also the interface that individual nodes have to implement will have to change,
but the current solution is a good starting point.

Only the triangulate node is implemented for now.
2020-10-22 15:05:41 +02:00
87218899be Geometry Nodes: add an initial geometry class 2020-10-22 15:02:27 +02:00
ffa0a6df9d Functions: add generic pointer class
This class represents a pointer whose type is only known at runtime.
2020-10-22 15:01:31 +02:00
706fa5ad76 Functions: add move operations to CPPType 2020-10-22 15:00:07 +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
b7f6de490d Geometry Nodes: Add initial node definition for edge split
This is just based on rBa7dba81aab22, and contains no funcionality at all.
2020-10-21 16:11:09 -05: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
7e485b4620 Merge branch 'master' into geometry-nodes 2020-10-21 08:54:39 -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
a7dba81aab Nodes: add initial UI for Triangulate node 2020-10-21 14:14:09 +02:00
4606e83a75 Merge branch 'master' into geometry-nodes 2020-10-21 14:00:32 +02: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
1d28de57a4 Nodes: improve dependency between modifier and node group 2020-10-21 13:16:19 +02:00
3cfcfb938d Nodes: support creating geometry node groups 2020-10-21 12:32:02 +02:00
bcdc6910a0 Nodes: show header in geometry node editor 2020-10-21 12:16:57 +02:00
7793e8c884 Modifiers: add node_tree to NodesModifierData 2020-10-21 12:13:13 +02:00
05d9bd7c4a Modifiers: rename Simulation to Nodes modifier 2020-10-21 12:03:06 +02:00
9255ce9247 Nodes: rename Simulation to Geometry node tree 2020-10-21 11:39:42 +02:00
819b1a7f9d Cleanup: Move scenes' foreach_id handling of toolsettings into own func. 2020-10-21 11:38:32 +02:00
a0ce0154e7 Merge branch 'master' into geometry-nodes 2020-10-21 11:11:16 +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
0cd7f7ddd1 Nodes: add geometry socket type
We still have to pick a color for this socket.

Ref T81848.
2020-10-20 15:31: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
0a66436fe5 Fix T76597: Support Keyframe: Copy To Selected
Reviewed By: Sybren, Luciano Muñoz Sessarego

Differential Revision: https://developer.blender.org/D7783
2020-10-15 14:55:09 -04:00
a88076e948 Fix error in previous commit
Missing null-check, could lead to null-pointer dereference.
2020-10-15 20:40:03 +02:00
d4f94d8a31 Cleanup: Refactor lookup for hovered Outliner element for renaming
* Use existing and optimized lookup function, rather than own duplicated logic.
* Move low-level coordinate check into general function, alongside similar
  ones.
2020-10-15 20:31:36 +02:00
5129e2e042 Fix T81675: Renaming collapsed collection in Outliner renames nested items
* `do_outliner_item_rename()` enables the rename mode for the item under the
  cursor. Issue is, collapsed children end up having stored the same coordinate
  as their parent, so they too would get the rename mode enabled (there is no
  early-exit that would hide this).
* The items displayed as inline icons do get the proper coordinates of the
  icons, so they are not mistaken as being under the cursor.

After rBb077de086e14, the Outliner tree is rebuilt less often, so the
coordinates are cleared less often too.

As far as I can see we can always clear coordinates of invisible items now. No
code seems to depend on keeping the old coordinates anymore.
2020-10-15 20:31:36 +02:00
5efb104003 Silence warning 2020-10-15 20:03:26 +02:00
c866075dfb Fix T81580: No doversion for Emission Strength
The new parameter made so that previously keyed Alpha values were lost
and instead the new "Emission Strength" was keyed.

Issue introduced with the original commit of Emission Strength: b248ec9776

Note: Files created since the issue (September 17) that keyframed the
Emission Strength will have to fix their files manually.

Differential Revision: https://developer.blender.org/D9221
2020-10-15 19:59:58 +02:00
ca55a1b564 Fix Cloth brush grab artifacts in the affected area
The cloth brush grab mode was creating constraints at 1.0 strength in
the area of the brush where the fade was evaluated to 1. This was causing
stability issues in the simulation and not producing ideal results.
Now the constraint strength is scaled with an empirically found factor.

The values in this patch may require further tweaking after experimenting
a little bit more with them.

Reviewed By: sergey, zeddb

Differential Revision: https://developer.blender.org/D9201
2020-10-15 19:54:41 +02:00
91af828e8b Fix T81743: Changed behaviour in RGB Curves node interpolation
Restore the old `correct_bezpart()` (pre-rBda95d1d851b4) function as
`BKE_curve_correct_bezpart()`, and use that where the old behaviour was
desired (that is, curve maps like used by the RGB Curves shader node).

The new (post-rBda95d1d851b4) function is also renamed to
`BKE_fcurve_correct_bezpart()` to avoid confusion.
2020-10-15 19:48:14 +02:00
229b9f1299 Fix brush tip delta orientation with anchored strokes
When using anchored stroke, the stroke operator was modifying the
coordinates on the "mouse" rna property by setting them to the original
position. Because of this, all the sculpt delta calculation was failing
and the delta for these brushes was set randomly (with a 0 vector) at
the beginning of the stroke.
There is now an extra property that uses the unmodified coordinates of
the mouse to calculate the delta. Now delta orientation works as expected
in all brushes and features that require brush tip orientation.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D9183
2020-10-15 19:45:43 +02:00
6991b13e41 Fix T81649: Cloth simulation dynamic area mode tearing the mesh
Dynamic area should use the radius instead of the initial radius to get
the nodes as the radius can now change during the stroke. In case of
anchored strokes, the current radius can be bigger than the initial
radius, simulating vertices outside the falloff area and breaking the
mesh.

Reviewed By: sergey

Maniphest Tasks: T81649

Differential Revision: https://developer.blender.org/D9181
2020-10-15 19:40:27 +02:00
ef5f307031 Sculpt: Use mpoly flags to sync Face Sets visibility
Previously, all Face Set visibility logic was using mvert flags directly
to store the visibility state on the vertices while sculpting. As Face
Sets are a poly attribute, it is much simpler to use mpoly flags and let
BKE_mesh_flush_hidden_from_polys handle the vertex visibility, even for
Multires.

Now all operators that update the Face Set visibility state will always
copy the visibility to the mesh (using poly flags) and the grids, all
using the same code.

This should fix a lot of visibility glitches and bugs like the following:
 - Sculpt visibility reset when changing multires levels.
 - Multires visibility not updating in edit mode.
 - Single face visibible when surrounded by visibile face set, even when
the face set was hidden.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D9175
2020-10-15 19:39:11 +02:00
750e4e1158 Fix Multires edge adjacency info returning wrong vertex indices
ME_POLY_LOOP_NEXT and ME_POLY_LOOP_PREV expect the offset of
the loop in the poly as an argument, in other words, corner index of the poly.
This was violated in some places. It didn't cause issues when base mesh consists
of only quads due to the way how modulus worked inside of the macro. However,
if mesh had non-quad faces adjacency information was returning wrong vertex
 indices. This was causing multiple brushes to work erratically, including brushes
like Face Set, Boundary automasking, mesh relax, and others.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D9173
2020-10-15 19:37:56 +02:00
6fe3521481 Sculpt: Add global automasking settings support in filters
When using the sculpt filters, global automasking settings that affect
all brushes were ignored because the automasking system was not
implemented for filters, making filters and brushes react differently
to the global sculpt settings which creates confusion.

This makes all filter tools (mesh, cloth, color) use the same general
automasking settings and features as the brush tools. Filters will now
use the settings in the options panel to limit their effect.

This also removes the "use Face Sets" option from the Mesh filter code,
as it was duplicated from the automasking code just to have that
funcitonality. This is now handled by the regular automasking system.

The "Use Face Sets" option is still available in the cloth filter as that
option limits the action of the forces, not the displacement.

After this, it is possible to initialize the automasking system
independently from the StrokeCache and Brush settings, so it can also be
added to more tools and features in the future.

Fixes T81619

Reviewed By: dbystedt, sergey

Maniphest Tasks: T81619

Differential Revision: https://developer.blender.org/D9171
2020-10-15 19:35:37 +02:00
da7ace00d5 Sculpt: Use cursor depth in trimming gestures
This adds an operator property to use the paint cursor radius and
position for the depth of the trimming shape created by the trimming
tools.
When enabled, the shape is located in the surface point when the gesture
started and it will have the depth of the cursor radius. When the cursor
is not over the mesh, the shape will be positioned at the center of the
depth of the whole object from the viewport camera.

Reviewed By: dbystedt, sergey

Differential Revision: https://developer.blender.org/D9129
2020-10-15 19:15:04 +02:00
b9e4696641 Sculpt: Show paint brush cursor in all tools
This patch enables the paint brush cursor with all tools in sculpt mode,
even with the ones that are not brushes. The motivations for this change
are:
- The filters are using the position of the active vertex for certain
features without any visualization of what the active vertex is.

- You can call operators like mask expand (which depends on the brush
cursor position and active vertex) with a non brush tool enabled.

- Having the cursor in the rest of the tools allows to have a scene
scale representation of the radius and a direct control of radius and
strength (using the current brush shortcuts), which will allow to make
features more intuitive without relying on modifying values in the
topbar. For example, the brush radius can be used to control the depth
of the cut in the trimming tools or the size of the sphere in the
sphere mesh filter

Reviewed By: #user_interface, dbystedt, pablovazquez

Differential Revision: https://developer.blender.org/D9071
2020-10-15 19:03:35 +02:00
4b99ea17fb Fix mask expand creating wrong masks when the cursor is not over the mesh
This forces the mask expand modal operator to use the maximum
iteration when the cursor is not over the mesh, masking the entire
connected component.

This fixes the issue for both expanding masks and face sets.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D9105
2020-10-15 19:02:02 +02:00
Pablo Dobarro
0d5ec990a9 Sculpt: Experimental Pen Tilt Support
This adds support for pen tilt in sculpt mode. For now, pen tilt is used
by tweaking the tilt strength property, which controls how much the pen
angle affects the sculpt normal. This is available in Draw, Draw Sharp,
Flatten, Fill, Scrape and Clay Strips brushes, but it can be enabled in
more tools later.

The purpose of this patch is to have a usable implementation of pen tilt
in a painting mode, so users can test and see in which hardware and
platforms this feature is supported and how well it works. If it works
ok, more tools and features that rely on pen tilt can be implemented,
like brushes that blend between two deformations depending on the angle.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D8893
2020-10-15 19:00:51 +02:00
6dda0779fc Fix T80625: Trimming tools not working with transformed objects
The code to handle object transforms was wrong. Now the trimming mesh
and depts is calculated in world space, using the real view origin and
normal and then stored in object space in the mesh and in the original
coordinates array. As now both meshes for the boolean operation are in
the same object space, the space conversion code can also be removed
from the boolean function.

Reviewed By: sergey

Maniphest Tasks: T80625

Differential Revision: https://developer.blender.org/D8852
2020-10-15 18:55:26 +02:00
Leha
0fed1bea65 Improve Voxel Remesher volume projection artifacts on sharp edges
The voxel remesher was using the voxel size to limit the shrink-wrap
projection distance. Now that distance is increased to help preserving
more detail on hard surface edges.

Reviewed By: pablodp606

Differential Revision: https://developer.blender.org/D6204
2020-10-15 18:51:26 +02:00
e7ab802ab0 Fix T81697: Property search crash with python handlers
Previously I used `CTX_copy` to create a mutable copy of the context in
order to set its area and region fields to temporary variables. This was
a tradeoff to avoid casting away `const` for `bContext`.

However, `bpy.context` is set to this new temporary value, which is fine
for a single `wm_draw_update` pass, but in the next main loop,
`bpy.context` is still set to this value, which was freed at the
end of `property_search_all_tabs`. It would be possible to reset the
`bpy.context` variable ath the end of the function, but this patch
contains an alternate solution: just don't copy the context. It looks
like this was the only use of `CTX_copy` anyway, maybe for good reason.

Differential Revision: https://developer.blender.org/D9216
2020-10-15 10:08:39 -05:00
15d78ea85b UI: Add reset to default value to keymap
With all the work on DNA defaults for 2.91, it's nice to expose this
convenient operator. This was already hardcoded in the UI code to the
backspace key, adding it to the keymap instead will make the shortcut
automatically show in the button right click menu.

Differential Revision: https://developer.blender.org/D9219
2020-10-15 10:02:44 -05:00
d1b3439b80 Cleanup: Use DNA defaults for grease pencil modifiers
This will make "Reset to Default Value" work properly for grease
pencil modifiers. See T80164 for more information.
2020-10-15 09:44:39 -05:00
bac91956ae CMake/macOS: set package_ROOT for PNG, JPEG, TIFF
https://devtalk.blender.org/t/libpng-version-mismatch/15799/

In this case, CMake finds libraries in `LIBDIR`, but picks headers from
`/Library/Frameworks/` (Mono framework).

CMP0074 is already enabled, so use it.
2020-10-15 18:49:45 +05:30
78d1aa4d52 Cleanup: Animation, simplify channel selection code
Split up `ANIM_deselect_anim_channels()` into
`ANIM_anim_channels_select_set()` and
`ANIM_anim_channels_select_toggle()`.

`ANIM_anim_channels_select_set()` is equivalent to the old
`ANIM_deselect_anim_channels(..., false, ACHANNEL_SETFLAG_xxx)`.

`ANIM_anim_channels_select_toggle()` is equivalent to the old
`ANIM_deselect_anim_channels(..., true, ACHANNEL_SETFLAG_ADD)`.

`ANIM_deselect_anim_channels(..., true, ACHANNEL_SETFLAG_CLEAR)` was
also called once. The `true` parameter suggested the "toggle" behaviour
was intended, but the `ACHANNEL_SETFLAG_CLEAR` argument prevented any
toggling. This is now replaced with `ANIM_anim_channels_select_set(ac,
ACHANNEL_SETFLAG_CLEAR)` to make this explicit.

No functional changes, just a cleanup in order to better understand how
the selection works.
2020-10-15 14:04:14 +02:00
1ec1e36ac1 Cleanup: Animation, rename function to match operator
Rename `animchannels_deselectall_exec` → `animchannels_selectall_exec` so
that it matches the operator `ANIM_OT_channels_select_all`.

No functional changes.
2020-10-15 14:04:14 +02:00
d6fd03616e Fix part of T74918: 3D Viewport: Jump, when mouse crosses a window corner.
We need a separate time stamp for each axis, and we have to add a few
milliseconds of padding to those, to ensure wrapping on both axes get
properly performed when it happens almost simultaneously, and avoid
extra wrapping caused by very close events sometimes.

This only addresses the Linux (X11 backend) case.

Differential Revision: https://developer.blender.org/D9209
2020-10-15 13:55:09 +02:00
f1aa55b6e9 Cleanup: rename BPy_GetContext -> BPY_context_get
Matching BPY_context_set.
2020-10-15 19:00:17 +11:00
5531697f6d Cleanup: remove duplicate context variable (__py_context)
The context was stored both in __py_context & bpy_context_module.

This avoids duplicate functions to update them too.
2020-10-15 19:00:16 +11:00
Janusch Patas
1cc3abca70 Fix T80768: Subdivision Surface modifier uses viewport subdivision settings when rendering in edit mode
Being in render 'context'was not taken into account in code evaluating
modifiers for meshes in Edit mode.

Reviewed By: #modeling, mont29

Differential Revision: https://developer.blender.org/D9217
2020-10-15 09:46:22 +02:00
7b951ba5c3 Cleanup: Do not compare bool value to 0. 2020-10-15 09:31:40 +02:00
1001adb500 Fix T81520: Crash setting the Cycles device from Python 2020-10-15 16:53:38 +11:00
4bea4702d5 PyAPI: throw exception when cycles is given an invalid device name 2020-10-15 16:35:41 +11:00
c0dde8be84 Cleanup: defer importing '_cycles' in properties.py
This was imported already in nearly all usage.

Also use static-set for string comparison.
2020-10-15 16:25:26 +11:00
aca8640b12 Cleanup: use defined sizes when accessing file date/time
Also add static assert for struct size assumption.
2020-10-15 10:54:06 +11:00
a509e79a4c Cleanup: Comment formatting, grammar 2020-10-14 15:04:49 -05:00
11a8a6d0e6 Fluid: Add phystype to fluid particle settings
When creating a particle system to display simulated particles, the phystype needs to be set to 'no physics' so that particle positions are just copied and not integrated.
2020-10-14 21:58:58 +02:00
Juanfran Matheu
53792e32e7 UI: Show more information in open file tooltip
This shows the file's full path, its modification date, and its size in
the tooltips for the open recent fiels menu. When no file path is set,
the original operator description is used.

Differential Revision: https://developer.blender.org/D9028
2020-10-14 13:57:31 -05:00
adc0291061 Fix T81633 Workbench: TAA never resolve when enabling both X-Ray and cavity
This was caused by a wrong flag equality check when in xray mode because
the xray mode was masking the effect option flags that are not supported
in this mode. This means the never passed and the TAA was reset before
every redraw, leading to infinite rendering.
2020-10-14 19:26:44 +02:00
57de568604 Fix T81004 Python: Images drawn in the Sequence Editor have wrong colors
This was caused by the sequencer using a sRGB buffer without using
the sRGB transform.

This patch make it so that the framebuffer is rebound using the
sRGB transform before the python draw callbacks.
2020-10-14 18:53:41 +02:00
3271074120 GL: FrameBuffer: Set GL_FRAMEBUFFER_SRGB if needed
This makes possible to rebind the same GPUFrameBuffer to enable or
disable sRGB encoding transform.
2020-10-14 18:53:41 +02:00
4fa4245464 PyDocs: GPU Module: Examples: convert all gl_FragColor variables to FragColor
Based on D6425 by @robbott

Differential Revision: https://developer.blender.org/D6425
2020-10-14 11:18:36 -04:00
50d78116cd Fix warning for duplicate field in DNA defaults
Caused by a typo in rBd3b59d1358424371. Thanks to @ankitm for reporting.
2020-10-14 10:09:28 -05:00
1cf8a4e5ea Fix Asan warning in property editor texture tab
When there is no active texture, a NULL pointer was dereferenced.
It didn't crash because the dereference was for the first item at the
pointer, the ID. To fix this, return with no data when `texture is NULL.
2020-10-14 10:00:24 -05:00
fecb276ef7 UI: New option to invert search filter in Dopesheet
A lot of animator request an option to invert the filter of the dopesheet channels. This patch adds that invert filter option. This is not for Grease Pencil only, affect to all modes.

{F8983328}

Note: I have seen the new button has a rounded borders on the left. It would be better get rectangle shape, but not sure how to do it.

Reviewed By: campbellbarton, pepeland

Maniphest Tasks: T81676

Differential Revision: https://developer.blender.org/D9182
c68a2a
2020-10-14 15:24:52 +02:00
459618d860 UI: Change Invert Filter icon for UIList
This makes the icon equals to the invert icon used in all modifiers.

{F8986444}

Reviewed By: #user_interface, Severin, Blendify

Differential Revision: https://developer.blender.org/D9194
3bb3b2
2020-10-14 15:24:52 +02:00
9d2222b7d1 Cleanup: Use enum for return type
This just follows up rB90a27d5aa91a1 with a few changes where
changes were missed.
2020-10-14 07:42:42 -05:00
3e25f70ddd Fix compile error in lite build after recent commit
Mistake in my own commit rBd3b59d1358.
2020-10-14 07:39:59 -05:00
0d52504dff BLI_ghash_performance_test: Fix memory leaks
Reviewed By: mont29

Differential Revision: https://developer.blender.org/D9210
2020-10-14 18:05:47 +05:30
d3b59d1358 Cleanup: Use DNA defaults for fluid modifier
This will make the "Reset to Default Value" operator in button right
click menus work for the fluid modifier. Before they always reset
the values to 0.

Differential Revision: https://developer.blender.org/D9206
2020-10-14 07:14:51 -05:00
a181b15639 Tests: use environment variable for leak sanitizer
Don't override other `LSAN_OPTIONS` like suppression file set in
the environment variable.

Old code added in {rB38ff5064b33ccb8} and {rB5f4e99b7a2b8376}

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D9207
2020-10-14 16:53:49 +05:30
5edba9b42f Fix T81688: BPY_thread_save crashes with Python 3.9
Calling PyEval_ReleaseLock() was crashing with Python 3.9
because it accessed the NULL pointer set by PyThreadState_Swap().

This happened when calling ViewLayer.update() for example.

While the existing logic could be fixed by swapping the thread-state
back before calling PyEval_ReleaseLock(), this depends on functions
which are tagged to be removed by v4.0.

Replace use of deprecated functions by calling PyEval_SaveThread(),
instead of inlining the logic, using _PyThreadState_UncheckedGet()
to prevent Python aborting.

The call to PyEval_ThreadsInitialized has been removed
as threads are now initialized with Python.
This could be replaced with Py_IsInitialized() however it doesn't look
like this is necessary.

This is compatible with Python 3.7 & 3.9.
2020-10-14 18:52:02 +11:00
2d4f1afece Cleanup: reduce indentation level in bpy_class_validate_recursive 2020-10-14 16:21:13 +11:00
0133bcaf38 Fix crash starting Blender with Python 3.9
In 3.8 and older the class held a reference to methods,
this is no longer the case in 3.9.
2020-10-14 16:15:44 +11:00
cb40edf63a Fix T81686: Confusing add menu in pose mode 2020-10-14 15:39:56 +11:00
c7cd74fac3 Cleanup: multi-line comment blocks 2020-10-14 15:24:42 +11:00
863b38d708 Cleanup: commented includes 2020-10-14 15:12:40 +11:00
862b5b1842 Fix T81511: Loop-cut overlay doesn't follow deformed cage
With constructive + deform modifiers, loop-cut visualization
wasn't following the displayed mesh.

This now gets the coordinates from the cage when available.
2020-10-14 14:49:22 +11:00
deca7c7954 Cleanup: spelling 2020-10-14 14:43:54 +11:00
2cc7be3e49 Fluid: Removed fluid levelset argument from pressure solve
It seems that this was causing the instabilities at slanted obstacles (with secondary boundary (fractional) collisions enabled) ...
2020-10-14 00:29:43 +02:00
3d1b5e35bd Fluid: Enabled OpenVDB precision argument
This way particles can be saved with the custom OpenVDB precision options that were introduced in the latest Mantaflow update.
2020-10-14 00:29:43 +02:00
2ec07dfa18 Fluid: Update Mantaflow source files
Updated files includes:
- Fix for smoke / fire emission from particles
- Custom precision for liquid particles when saving in OpenVDB format
2020-10-14 00:29:43 +02:00
5f49f818d6 Fixes T81670: Sculpt paint vertex colors brush does not switch to secondary color using CTRL
This was just not implemented. Now make this consistent with
vertexpainting / texturepainting.

Maniphest Tasks: T81670

Differential Revision: https://developer.blender.org/D9195
2020-10-13 22:01:58 +02:00
ec9edd36ca Sculpt: Use plasticity for softbody influence
Previously the softbody strength property was controlling the strength
of the constraints that pin all vertices to the original location. This
was causing problems when the forces were trying to deform the vertices
too much, like when using gravity or grab brushes.

Now softbody is implemented with plasticity, which creates constraints to
a separate coordinates array. These coordinates are deformed with the
simulation, and the plasticity parameter controls how much the
simulation moves the coordinates (plasticity 0), or the coordinates move
the simulation back to its previous position (plasticity 1).

This creates much better and predictable results and adding softbody
plasticity to the brushes can increase its control and the stability of
the simulation.

Reviewed By: sergey, zeddb

Differential Revision: https://developer.blender.org/D9187
2020-10-13 21:53:07 +02:00
9722e369cd UI: Motion Tracking: Make Lens a subpanel of Camera
The camera presets control lens settings too so these setting should be 
part of the camera panel.
2020-10-13 15:47:36 -04:00
a36f02f9ba Fix (unreported) LibOverride: possible uninitialized return variable. 2020-10-13 20:38:04 +02:00
72cfeb2c4e Fix T81674: LibOverride: 'Define Override' UI operation can crash.
Case where RNA is not able to generate a proper path for a property was
not taken into account properly.
2020-10-13 20:38:04 +02:00
be3841b1bf Cleanup: Use doxygen sections in space_buttons.c 2020-10-13 13:23:57 -05:00
7c633686e9 Property Search: Find results in all tabs
This patch enables property search for all tabs in the property editor.
To make interaction faster, if the editor's current tab doesn't have a
result, the current tab changes to the next tab that has a match.

This patch implements basic code that only searches panels.
While we could run the existing "single tab" property search for every
tab, that would also do everything else related to the layout pass,
which would be less efficient, and maybe more complicated to maintain.

The search match status for every current tab of the property editor is
stored in a runtime bitfield and them displayed later by dimming icons
in the tab selector panel to the left. Using `BLI_bitmap` properly in
the runtime struct required moving it to `buttons_intern.h` and
adding a small API to access the search filter instead.

To make sure the editor isn't influenced by anything that happens while
building the layout for other tabs, most of the context is duplicated
and the new search is run in the duplicated editor.

Note that the tool settings tab works slightly different than the other
tabs, so I've disabled searching it for this commit. That would be a
relatively simple improvement, but would just require a bit of
refactoring of existing code.

Differential Revision: https://developer.blender.org/D8859
2020-10-13 13:10:41 -05:00
96dd299055 UI: Add highlight arguments to tab buttons
This adds arguments to `uiLayout.prop_tabs_enum` and the C equivalent
(`uiItemTabsEnumR_prop`) to gray out tabs based on a boolean array.

For property search in multiple tabs, we need a way to show which tabs
have a search result, but we still need to show which tab is active.

Differential Revision: https://developer.blender.org/D8858
2020-10-13 12:43:28 -05:00
9fe5817588 UI: Monochrome Alert Icons not changing color until theme refresh
Changing the color of monochrome alert icons would not change until the theme was reloaded.

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

Reviewed by Harley Acheson
2020-10-13 09:35:46 -07:00
b7afcdff7b EEVEE: Motion Blur: Add shutter position option
This makes it easier to generate motion trail effect with EEVEE.

This just mimics the cycles option as described here:
https://docs.blender.org/manual/en/latest/render/cycles/render_settings/motion_blur.html

This fix T80070
2020-10-13 18:09:07 +02:00
ed96c59c20 Fix T80086 EEVEE: Motion Blur: Subframe not taken into account
This is a simple fix that just make it work like cycles. The initial time
was missing the subframe offset.
2020-10-13 18:09:07 +02:00
Eric Cosky
dd3b047f8b Windows/CMake:Support BLENDER_USER_SCRIPTS in IDE
This diff adds support for respecting the `BLENDER_USER_SCRIPTS`
environment variable when setting up the IDE environment.

Previously the scripts from the users profile folder were always
used even when this variable was set, leading to the possibility
of the wrong scripts being visible in the IDE.

Differential Revision: https://developer.blender.org/D9189
Reviewed By: Ray Molenkamp
2020-10-13 08:45:22 -06:00
48b52e06b0 Cleanup: Remove unused properties from node Viewer Region operator
The operator would define the `deselect` and `extend` properties,
without actually using them. It's confusing to have them in the keymap
item UI.
2020-10-13 15:53:27 +02:00
c82d167d81 Cycles: fix missing ShaderNode ownership in render_graph_finalize_test 2020-10-13 15:38:57 +02:00
3bb3b26c8f Cycles: Add CUDA 11 build support
With this patch the build system checks whether the "CUDA10_NVCC_EXECUTABLE" CMake
variable is set and if so will use that to build sm_30 kernels. Similarily for sm_8x kernels it
checks "CUDA11_NVCC_EXECUTABLE". All other kernels are built using the default CUDA
toolkit. This makes it possible to use either the CUDA 10 or CUDA 11 toolkit by default and
only selectively use the other for the kernels where its a hard requirement.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D9179
2020-10-13 15:15:44 +02:00
ae609346ee Fix T81672: Array modifier default merge distance is 0.1m (typo)
Seems to be an oversight/typo in rB83980506957c.
Now set back to 0.01m (as it was before).

Maniphest Tasks: T81672

Differential Revision: https://developer.blender.org/D9193
2020-10-13 14:46:39 +02:00
16289274ed Fix T81656: Crash relocating a linked library into the current .blend
A .blend file cannot use itself as a library.
This is prevented when linking manually, but was still possible when
relocating, which is now prevented.

Maniphest Tasks: T81656

Differential Revision: https://developer.blender.org/D9191
2020-10-13 14:37:17 +02:00
79875e37fe Cleanup: remove redundant assignment in SCULPT_brush_test_init
As discussed in D9120, this was an oversight in rBe0c792135adf, the same
assignment already happens a couple of lines above.
2020-10-13 13:17:01 +02:00
c11ae5cd21 Fix sculpting/painting with viewport clipping and radial symmetry
This was reported for sculpting, the same is true for weightpaint or
vertexpaint though.

When viewport clipping and radial symmetry are enabled, the
'sculpt_brush_test_clipping()' function was not considering radial
symmetry at all, so if the coordinate was outside the clipping planes,
no action would take place. Now the coordinte is brought back to where
the stroke actually happens and that is checked against clipping.

Since other mirroring options while painting/sculpting (as well as
editmode operations with mirroring) usually still take place even if the
mirrored coord is outside the clipping planes, this should also be the
case for radial symmetry.

This grows the 'SculptBrushTest' struct a bit, but should be acceptable?

Fixes T81466

Maniphest Tasks: T81466

Differential Revision: https://developer.blender.org/D9120
2020-10-13 13:17:01 +02:00
3f78569c3e Fix (unreported) liboverride of an object hiding its dependencies.
When we override a whole collection, we want to add non-instantiated
objects to a hidden sub-collection at the end of the process.

However, this makes no sense when instantiating an object, if other
dependencies objects get also overridden on the process, we should just
add them to the same collection owning the root object.
2020-10-13 13:08:41 +02:00
666485f38c CMake/macOS: find ZLib before setting CMAKE_PREFIX_PATH
https://devtalk.blender.org/t/building-blender-on-macos-fails/15756/

In some cases, CMake finds the Zlib supplied with OpenCollada
pre-compiled libraries, and not the system one.
2020-10-13 16:34:43 +05:30
6b21b82704 Fix (unreported) broken 'make override' of objects in master collection.
Master collections are not in Main list of collections, so we also need
to check the scenes.
2020-10-13 12:26:44 +02:00
7d5d567dba Cleanup: Fix typo in function name. 2020-10-13 12:17:50 +02:00
344c001eae Fix T81669: Vertex size in UV Editor changes using Face Dot Size in themes
Probably copy-paste error in rBd6525e8d133b.

Maniphest Tasks: T81669

Differential Revision: https://developer.blender.org/D9190
2020-10-13 11:51:18 +02:00
211d7ff3cf Fix T81288:Select Linked fails with multi-object edit mode
Changing options after using select-linked didn't work
when the object being selected wasn't the active object.
2020-10-13 16:59:38 +11:00
65965a892f Cleanup: use BKE_fcurve_ prefix for keyframing bezier functions
- BKE_bezt_subdivide_handles -> BKE_fcurve_bezt_subdivide_handles
- binarysearch_bezt_index -> BKE_fcurve_bezt_binarysearch_index

These functions are specific to F-Curves and don't make sense for other
uses of BezTriple (curve-object data for e.g.)

Also:

- Move detailed doxygen comment above code, following code-style.
- Mark bezt_add_to_cfra_elem unused.
2020-10-13 16:46:41 +11:00
8335c26119 Fix T81467: Crash with KD-Tree Weld Modifier
The problem is related to the `use_index_order` option of `BLI_kdtree_3d_calc_duplicates_fast`.
With this option, the higher index is expected to be less than `tree->nodes_len`.
2020-10-12 20:29:15 -03:00
8427e02abc Fix T81589: Correct drag type handling in outliner
Blender crashed when dragging and dropping color into the outliner.
This issue was cause by a missing check for the correct drag type
in `datastack_drop_poll`. The check is added in this commit.
Additionally, a new drag type is introduced for the "data stack"
drag option, that was introduced in commit 1572da858d, to
differentiate it from the existing WM_DRAG_ID type.

Reviewed By: Severin

Differential Revision: https://developer.blender.org/D9169
2020-10-13 01:17:36 +02:00
Yevgeny Makarov
dc71ad0624 UI: Monochrome Alert Icons and use the Question icon in the Quit dialog
Change to monochrome version of the large alert icons and use 'Question' for the the Quit Confirm dialog box.

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

Reviewed by Pablo Vazquez
2020-10-12 15:51:00 -07:00
1d84881ac1 Cleanup: remove duplicate code
This code segment is exactly the same as above.
Looks like it was copied accidentally.
2020-10-12 21:14:14 +02:00
19dcd32ee5 UI: Remove Hard-coded Default Font Size
Default text output routines (which do not specify a size) will now use Text Style point size.

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

Reviewed by Brecht Van Lommel
2020-10-12 09:53:00 -07:00
1b7458f85a Cleanup: Rename outliner helper function
This name makes more sense and is consistent with related functions
(e.g. `outliner_requires_rebuild_on_select_or_active_change()`).
2020-10-12 18:21:12 +02:00
c1cee363cd Fix T81555: Outliner object state filter not updating correctly
When changing the selected, active or visible object(s), the Outliner
has to be rebuilt while using the corresponding object state filters.

The object hiding operators also have to send the proper notifiers (they
changed visibility without notifying about that).
2020-10-12 18:21:12 +02:00
6f0b082378 Animation: fix assertion failure on unsetting active keyframe
Avoid NULL pointer dereference when checking keyframe selection state in
`BLI_assert()` call.
2020-10-12 17:27:27 +02:00
058a69974a Cleanup: split animchan_sync_fcurve() into smaller functions
Split `animchan_sync_fcurve()` into functions for handling Scenes and
Node Trees.

No functional changes.
2020-10-12 17:00:11 +02:00
5e6c7de3e9 Animation: enforce that the active keyframe is always selected
Check selection state in `BKE_fcurve_active_keyframe_index()`, and only
return the active keyframe index when that keyframe is actually selected.
This is now also asserted in the `BKE_fcurve_active_keyframe_set()` function,
which is now also used when inserting a keyframe.
2020-10-12 17:00:11 +02:00
0d3e192660 Fix T81551: Cycles crash updating volume with modifiers
The volume bounds mesh was being rebuilt too often, it should only be done
when rebuilding the BVH as well, otherwise they can go out of sync.
2020-10-12 16:56:41 +02:00
c68a2a722d Fix T80599 Blender Cloud folder text on the screen very small
This was caused by BLF conflicting with BGL api change.
2020-10-12 15:33:01 +02:00
f56c5245d2 Cleanup: CMake: Remove arguments from endif(..)
No functional change. Added in {rB1f6b7387ad01}
2020-10-12 18:51:48 +05:30
370ed6025f File Browser/macOS: Don't treat .app as directory
While there are other bundles which show up as directories,
`.app` are the most common ones.

*Users should not be saving anything inside .app bundles, nor using
Blender to edit any of the files.
*This declutters the File Browser for say ~/Applications folder
or recursive search on a path with apps.
*Matches Finder's behavior of showing apps as files. (We don't have a
"right click > show package contents" button like Finder though)

This change shows `.app` files like incompatible files, or `.exe`s
on Windows.
{F8970986}

Reviewed By: #platform_macos, brecht, mont29

Differential Revision: https://developer.blender.org/D9162
2020-10-12 18:45:39 +05:30
c4c8d855c6 Libmv: Remove array access from camera intrinsics
That was a suboptimal decision from back in the days, which ended up
being problematic. It is no longer used, so remove it from API making
it so new code does not depend on this weak concept.
2020-10-12 15:12:17 +02:00
ff5e3d6834 Libmv: Fix wrong packing order of intrinsics for BA step
The order got broken when Brown distortion model has been added.
Made it so the indexing of parameters is strictly defined in the
parameter block, matching how parameters are used in the cost
function.

There is some duplication going on accessing parameters. This can
be refactored in the future, by either moving common parts packing
and cost function to an utility function in bundle.cc.
Alternatively, can introduce a public PackedIntrinsics class which
will contain a continuous block of parameters, and each of the
camera models will have API to be initialized from packed form and
to create this packed form.

The benefit of this approach over alternative solutions previously
made in the master branch or suggested in D9116 is that the specific
implementation of BA does not dictate the way how public classes need
to be organized. It is API which needs to define how implementation
goes, not the other way around.

Thanks Bastien and Ivan for the investigation!
2020-10-12 15:12:17 +02:00
86138d88f6 Revert "Fix critical lens distortion bug in libmv after rB3a7d62cd1f5e."
This reverts commit 7e836bde11.

Reverting the incomplete workaround, due to the following reasoning:

- There should be no dependency between CameraIntrinsics and the bundler
  code. This violates intended abstraction of the intrinsics class.

- The fix was not complete, or wrong. Even in the world where there is
  a requirement to the parameters storage size this should have applied
  to all distortion models, including Divisions, Nuke.

Proper fix will be committed next.
2020-10-12 15:12:17 +02:00
df5b65811e Libmv: Fix memory leak in modal solver
The leak was happening when problem did not have any parameters blocks
defined. This happens, for example, if there are no 3D points at all,
or when all markers are set to 0 weight.

Was noticeable in libmv_modal_solver_test when building with LSAN
enabled.
2020-10-12 15:12:17 +02:00
590220e451 Libmv: Cleanup, spelling in function name
Is a local function, not affecting API.
2020-10-12 15:12:17 +02:00
db8a856a74 BLI: support looking up a key from a set or adding it when not existant 2020-10-12 15:10:08 +02:00
662c0ac970 Overlay: Fix Line antialiasing broken for some objects
Fix regression introduced in rBe12767a0352a9e113892b4a07c6c8446d3ff361f

The volumes are not a line type and should not be render into the line
framebuffer nor it should change the framebuffer.
2020-10-12 15:04:28 +02:00
60ba69ffb5 Cleanup: use openvdb matrices properly
Before I was double confused about how openvdb stores its
transformation matrices. Now, I know they have the same layout
physically in memory, but are logically transposed (i.e. the translation
is in the last row instead of in the last column).
2020-10-12 14:24:30 +02:00
e3ad392b98 Animation: always try to match the existing curve when inserting keys
Previously Blender would only match the existing curve slope when the
to-be-inserted key value was already very close to the curve. This check
is now removed, allowing for sliders in the graph editor to subtly
change the curve, and for keyframes added with ctrl+click to follow the
curve better.
2020-10-12 14:02:18 +02:00
aafd71a8a1 Fix T81060: CustomData Correction sometimes breaks UVs and Vertex Colors
`CustomData_bmesh_interp` use the same CustomData decryptor (in this case, `bm->ldata`) in both blocks.

So make sure that all CustomData layers match.

This commit also removes redundant `BM_elem_attrs_copy_ex` calls.

Maniphest Tasks: T81060

Differential Revision: https://developer.blender.org/D9159
2020-10-12 08:57:43 -03:00
ab65fe5a2d Fluid: Use hidden symbol visibility
This resolves a long list of linker warnings that is currently only showing up on macOS arm builds.
The warnings themselves are of this shape (one example):

```
ld: warning: direct access in function 'Manta::MeshDataImpl<Manta::Vector3D<float> >::_W_39(_object, object, object*)' from file '../../lib/libextern_mantaflow.a(mesh.h.reg.cpp.o)' to global weak symbol 'typeinfo for Manta::MeshDataImpl<Manta::Vector3D<float> >' from file '../../lib/libextern_mantaflow.a(mesh.cpp.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
```

Just would like to get your opinion to make sure this is an acceptable way to handle this on all platforms.

Reviewed By: LazyDodo

Differential Revision: https://developer.blender.org/D9002
2020-10-12 12:45:11 +02:00
e8d02359cf Volumes: reduce step and default of strength in Volume Displace modifier
The strength has a high impact on performance. With the previous
step and default one could easily and accidentally make Blender unusably
slow, because of a too high displacement strength.
2020-10-12 12:38:03 +02:00
fc5c5f0636 Animation: avoid WM notification when nothing changed
Avoid WM notification when a dummy channel is clicked in the animation
channel list (dopesheet, graph editor) if that channel has no animation
data.
2020-10-12 12:36:46 +02:00
1db26e1698 Cleanup: Animation, small cleanups on anim channel selection code
Clean up some code by using early returns.

No functional changes.
2020-10-12 12:36:46 +02:00
bfd7840358 Cleanup: Animation, split mouse_anim_channels() into separate functions
Clean up the code that handles mouse clicks on animation channels in the
non-NLA animation editors, by splitting into separate functions.

No functional changes.
2020-10-12 12:36:46 +02:00
7ae78733ef Volumes: use bounding box diagonal to compute adaptive voxel size
Using the diagonal has the benefit, that the adaptive voxel size changes
when the bounding box changes its shape in any way. Having a changing
voxel size looks bad when rendering an animation, therefore one should
usually use a fixed voxel size when rendering an animated volume.
This becomes apparent earlier, when the adaptive voxel size changes
when the bounding box changes in any way.
Otherwise this can easily go unnoticed when rendering only a few frames
of an animated volume.
2020-10-12 12:13:09 +02:00
cf778a9e42 Pydoc: BGL: update links 2020-10-11 20:14:16 -04:00
df3d124e91 Pydoc: Fix bpy.utils submodule showing in main toctree 2020-10-11 18:38:55 -04:00
72335d5e89 Pydoc: Move builtin GPU shader information to code
This fixes a compile warning for sphinx.
This commit includes some reformating of the information.
2020-10-11 18:21:28 -04:00
1b575cbb75 Cleanup: Pydoc strings 2020-10-11 18:19:42 -04:00
e8a2931299 Pydoc: Cleanup: Rename function
The new name makes more sense as the file is called index and we are not 
writing the contents of all rst files
2020-10-11 17:02:41 -04:00
a38c2dcfe6 Pydoc: Add index and genindex to main index 2020-10-11 16:54:52 -04:00
c95ab2c6f0 Pydoc: Remove old note about new module in 2.65 2020-10-11 16:46:21 -04:00
fbcb26fb33 Pydoc: Add submodule heading to submodule lists 2020-10-11 16:09:42 -04:00
c9a9b03204 Pydoc: Fix duplicate totree for freestyle 2020-10-11 15:50:24 -04:00
a0886d1b6e Cleanup: make format 2020-10-11 13:00:49 -04:00
1b04eb6c44 Exact Boolean: let Collection be empty.
With an empty collection, Exact Boolean performs the useful function
of removing self-intersections.
2020-10-10 12:05:09 -04:00
c68338ee89 CMake/macOS/OpenMP: copy the library near tests.
For multi-config generators, tests are in `bin/tests/<config>` folder.
and OpenMP cannot be found at `@executable_path/../Resources/lib`.
So create that folder and put the library there to be used by tests.

It is not ideal to copy the library around. When minimum CMake version
is changed to 3.12, FindOpenMP by CMake can be used for this whole
block of code. Then a nice rpath based solution can be used.
2020-10-10 19:31:03 +05:30
4427a67c86 Cleanup: use macro for comparing file versions
Already done in most of the versioning code.
2020-10-10 22:43:11 +11:00
5336555c31 Cleanup: spelling 2020-10-10 22:04:51 +11:00
d9a43a107f Cleanup: remove unused Modifier stackindex struct member 2020-10-10 22:04:51 +11:00
3fe98a473c Cleanup: remove unnecessary comments 2020-10-10 22:04:51 +11:00
2abfcebb0e Cleanup: use C comments for descriptive text
Follow our code style guide by using C-comments for text descriptions.
2020-10-10 22:04:51 +11:00
c735aca42e CMake/macOS/OpenMP: allow use of LLVM-Clang with OpenMP.
The "Apple" part is guaranteed by the platform file.
"Clang" is enough to differentiate it from other compilers.

Came across this due to the custom built LLVM toolchain I'm using.
2020-10-10 16:28:42 +05:30
7ab8d7c939 Cleanup: Declare variables where initialized 2020-10-09 16:39:39 -05:00
c1394c89a7 UI: Fix incorrect inactive status for curve properties
The "Geometry start & End" panel was grayed when using an object
to create the curve bevel. It should only be grayed out in this case
when no object is chosen in the "Bevel" subpanel.
2020-10-09 16:26:28 -05:00
89491d67d9 Fix T81545: Moving nested collections changes view layer flags
The code that restored collection flags after they are rebuilt when
moving a collection didn't take into account collection children. The
flag for the active collection was properly restored, but all of its
children would take on the exclude flag of the collection the active
collection was dragged into.

This commit builds a temporary tree structure to store the flags for
the moving collection and its children. Then it reapplies these flags
after `BKE_main_collection_sync`.

Differential Revision: https://developer.blender.org/D9158
2020-10-09 16:00:12 -05:00
4173877e87 Cleanup: Declare variables where initialized
Also use LISTBASE_FOREACH macro in a few places.
2020-10-09 15:08:01 -05:00
e6d1c8272e Cleanup: Use LISTBASE_FOREACH macro 2020-10-09 13:51:13 -05:00
32d4623f44 Cleanup: alias: use const, remove unused variable.
`targetIsDirectory` slipped through the code review of
{D6679}/{rBafb1a64ccb81}.
`BLI_is_dir` exists to check for directory status of a file.

Remove some `else-after-return`s.

Use `r_` prefix for return value arguments, and move it to the end
in the list of arguments.
2020-10-09 22:46:39 +05:30
62f5232f37 Fix T81573: Users refcount not incremented when creating a proxy.
Proxies are refcounting usages of objects, historical code was
apparently missing that.
2020-10-09 17:52:49 +02:00
50ffcf12b2 Cleanup: CMake/macOS: remove boost from OIIO libs.
Introduced by me in {rB1f6b7387ad0177c1dec9bb83b7}.
2020-10-09 20:39:58 +05:30
e340f943f5 Fix (unreported) install_deps: broken compilation of OIDN.
When OIDN version was bumped recently the required dependency to build
it (ISPC) was not updated accordingly.
2020-10-09 17:07:16 +02:00
Andreas Bergmeier
9aef0283a0 install_deps: Do not request elevated rights when creating directory in owned directory.
This only creates elevated directory when necessary.

Reviewed By: mont29

Differential Revision: https://developer.blender.org/D1596
2020-10-09 17:05:03 +02:00
2d94b0d6b0 GPU: Add more safeguard for BGL calls
This makes sure no BGL call before window drawing locks the GPUState.
2020-10-09 17:00:10 +02:00
16ca295278 Fix New Boolean bug that left some stray vertices.
The routine to find dissolvable vertices had a check to ensure
that the vertex was exactly in line with the two neighbors.
I have convinced myself that this check is unneccesary (it was
failing with only a 1e-9 difference from 0 on a cross check),
so have removed it.
2020-10-09 10:43:07 -04:00
14c53c5018 BGL: fix issues with addons using BGL at startup
This was an issue for Cycles.

This also makes the `GPU_bgl*` functions less fragile by checking for
null pointers.
2020-10-09 16:33:59 +02:00
d39043b5ae Revert "Revert "BGL: Workaround broken bgl usage caused by GPU refactor""
This reverts commit f23bf4cb10.
2020-10-09 16:33:59 +02:00
1f6b7387ad CMake/macOS: Remove _LIBPATH, avoid link_directories.
After tests were bundled in a single executable and cycles and libmv
created their own tests, the warnings on macOS have gone over 800.
The reason is setting `*_LIBRARIES` to names of the libraries
and later using `link_directories` to link them properly.

https://cmake.org/cmake/help/latest/command/link_directories.html

> Note This command is rarely necessary and should be avoided where
> there are other choices. Prefer to pass full absolute paths to
> libraries where possible, since this ensures the correct library
> will always be linked. The find_library() command provides the
> full path, which can generally be used directly in calls to
> target_link_libraries().

Warnings like the following popup for every target/executable,
for every library it links to.
```
ld: warning: directory not found for option
'-L/Users/me/blender-build/blender/../lib/darwin/jpeg/lib/Debug'
```

The patch completes a step towards removing `link_directories` as
mentioned in TODO at several places.
The patch uses absolute paths to link libraries and removes
all `*_LIBPATH`s except `PYTHON_LIBPATH` from
`platform_apple.cmake` file. (The corner case where it's used seems
like dead code. Python is no longer shipped with that file structure.)

Also, unused code for LLVM-3.4 has been removed.
Also, guards to avoid searching libraries in system directories have
been added.

`APPLE` platform now no longer needs `setup_libdirs`,
`cycles_link_directories`, and `link_directories`.
The number of warnings now is less than 100, most of them being
deprecation ones in dependencies.

This patch depended on {rBb746179d0add}, {rB2fdbe4d05011},
{rB402a4cadba49} and {rBd7f482f88ecb}.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D8855
2020-10-09 19:41:58 +05:30
83e91485d0 GPU: Fix NOT ~ operator for eGPUSamplerState
The real maximum was `GPU_SAMPLER_ICON`, not `GPU_SAMPLER_REPEAT`, my
bad. {rBa31a87f8943aa40}

Move `GPU_SAMPLER_MAX` out of the enum since it's used as an `int`
at many places.
Also, the macro `ENUM_OPERATORS` needs a maximum, and this enumerator
cannot be used as the argument of that macro. It creates wrong values
in the `~` NOT operator.

Thanks @deadpin for catching this.

Reviewed By: fclem

Differential Revision: https://developer.blender.org/D9157
2020-10-09 17:35:23 +05:30
701fc52cc6 Volumes: lower minimal voxel size in Mesh to Volume modifier
The 0.1 limit was too large. The issue with making it smaller is that
one can easily crash blender by making it to small. To counteract this,
the step has been reduced as well.

A voxel size/amount of 0 disables the modifier.
2020-10-09 12:55:13 +02:00
2f339eb745 BKE: improve calculating edges
This is a follow up commit for rB309c919ee9.
Clearing hash tables is now parallelized as well. Surprisingly, most of
the time is actually spent in `free` (a couple of milliseconds per call
in my test).

Benchmark of individual functions:
reserve_hash_maps: 17%
add_polygon_edges_to_hash_maps: 49%
serialize_and_initialize_deduplicated_edges: 12%
update_edge_indices_in_poly_loops: 14%
clear_hash_tables: 5%
2020-10-09 12:37:42 +02:00
309c919ee9 BKE: parallelize BKE_mesh_calc_edges
`BKE_mesh_calc_edges` was the main performance bottleneck in D9141.
While openvdb only needed ~115ms, calculating the edges afterwards
took ~960ms. Now with some parallelization this is reduced to ~210ms.

Parallelizing `BKE_mesh_calc_edges` is not entirely trivial, because it
has to perform deduplication and some other things that have to happen
in a certain order. Even though the multithreading improves performance
with more threads, there are diminishing returns when too many threads
are used in this function.

The speedup is mainly achieved by having multiple hash tables that are
filled in parallel. The distribution of the edges to hash tables is based on
a hash (that is different from the hash used in the actual hash tables).

I moved the function to C++, because that made it easier for me to
optimize it. Furthermore, I added `BLI_task.hh` which contains some
light tbb wrappers for parallelization.

Reviewers: campbellbarton

Differential Revision: https://developer.blender.org/D9151
2020-10-09 11:56:12 +02:00
963b45f574 Fix T81468: Missing NULL check for F-curve rna_path in versionning code. 2020-10-09 09:47:40 +02:00
Yevgeny Makarov
07bd16de5b UI: Fix node label overflow on high-DPI
Ref D9099
2020-10-09 18:20:50 +11:00
Andreas Bergmeier
2a39b6d4d1 Cleanup: spelling
Ref D9138
2020-10-09 18:08:38 +11:00
774905f7e8 CleanUp: Introduce eMeshBatchDirtyMode enum
It used to be an int mode.
2020-10-09 07:27:18 +02:00
048c5580c2 Revert "CleanUp: Introduce eMeshBatchDirtyMode enum"
This reverts commit 0796807720.
2020-10-09 07:25:43 +02:00
Yevgeny Makarov
b96f1f8091 UI: use Ctrl-TrackPad to cycle values
Minor change missing from 9bfea67751

Ref D8530
2020-10-09 14:04:34 +11:00
f735491b9f PyDoc: Set max width to 1000px
While not full width this gives a nice trade off between improved screen 
use space and readibility.
The old value was 80 so this gives 25% more screen space.

See T73223
2020-10-08 21:37:28 -04:00
decb3b10aa Cleanup: operator execution types didn't read well on one line 2020-10-09 12:14:22 +11:00
afc090f339 Cleanup: spelling 2020-10-09 12:12:29 +11:00
05710171cb PyDoc: resolve duplicate module warnings
Remove submodule listings from the module docstring,
as this information already exists in the generator.
2020-10-09 12:11:00 +11:00
c69df6728a Cleanup: use real-module for 'bmesh.ops'
Replace module-like object with Python module,
this simplifies checks for generating API docs and is more correct.
2020-10-09 12:11:00 +11:00
2d5e38d4ec Cycles: fix incorrect default value for node array socket type 2020-10-09 00:15:24 +02:00
70634ba438 Cycles: fix incorrect asserts in node socket set functions 2020-10-09 00:15:24 +02:00
3fae33b22c Fix broken compilation after adding particles DNA defaults.
Was failing because of a mismatch between RNA and DNA defaults on
`courant_target` property, removed RNA one (DNA came from initial value
defined in BKE's particle creation code, think it's best to keep that
one).
2020-10-08 23:10:36 +02:00
Yevgeny Makarov
3d4231babf UI: Fix opacity of the popover arrow outline
Due to the old AA method, it was necessary to add transparency to the
outline of the popover arrow to match the box outline opacity. This is
no longer required after rB15dda0115c78.

See the differential for before and after screenshots.

Differential Revision: https://developer.blender.org/D9026
2020-10-08 14:25:22 -05:00
e90638b911 Fix T80974 GPU: Wide Line emulation shader does not always works
This was caused by points well behind the near clip making the
computation of the width wrong.

The fix is to clip the line to the near clip plane.
2020-10-08 21:12:29 +02:00
a31a87f894 T81340: UBSan: load of value .. not valid for GPU enum type
The underlying type of the enum cannot be fixed here due to its usage
in C code.

All the values possible in the width of the underlying type are not
valid for an enum.
Only 0 to (2*max - 1) if all enumerators are unsigned.
So the macro asks for the biggest value among the //listed// ones.
If any enumerator C is set to say `A|B`, then C would be the maximum.
(2*max-1) is used as the mask.

The warnings (for each enum modified in this commit):
GPU_vertex_buffer.h:43:1: runtime error: load of value 4294967291
which is not a valid value for type 'GPUVertBufStatus'

https://github.com/llvm/llvm-project/commit/1c2c9867

Ref T81340

Reviewed By: fclem

Differential Revision: https://developer.blender.org/D9067
2020-10-08 23:14:25 +05:30
569510d704 Fix T81529: Can't move with constraint to a zero-size local axis
To fix the problem, it was necessary to create a fallback for the
zero-sized axis in local orientation.

This also affects the gizmos.
2020-10-08 13:39:41 -03:00
ea5f2f88b3 Cleanup: Move transform_orientations functions to separate header
Improves the organization and identification of the API.
2020-10-08 13:39:41 -03:00
dba0b84359 Cleanup: Simplify transform_orientation_matrix_get
This simplifies obtaining the parameters for internal functions.
(switch was complicating a little)

Also removes ureachable code.
2020-10-08 13:39:41 -03:00
043ddcf3ad Cleanup: Simplify use of 'Snapping Gears'
This commit removes `t->snap[0]` and `t->snap_spatial[0]`.

They were not actually being used, and could add overhead for
transformation without snap.
2020-10-08 13:39:41 -03:00
196d6166e5 Refactor CustomData interpolation code.
- Move some security checks outside of `interp` callbacks.
  Namely, that we do get interpolation weights, and have something to
  interpolate.
  Some callbacks where not checking on those anyway, safer to move that
  up into calling code.

- Cleanup usage of sub-weights, lots of interpolation callbacks wher
  actually using those completely wrong.

- Change default behavior when no weights are given to higher-level API
  functions: prevriously, each callback was responsible to handle that
  case (and one did not even do it!), they were switching to purely
  additive behavior then.
  Instead, we now default to expected simple average of source values.

Note that the only real important change here is defaulting to actual
average of source value when no inertpolation weights are given (afaik,
this only happens in Weld modifier code).

Differential Revision: https://developer.blender.org/D9114
2020-10-08 18:19:24 +02:00
cac0e78aff Cleanup/refactor: move init of ParticleSettings to proper place. 2020-10-08 18:19:09 +02:00
d6f409b862 Add DNA defaults for ParticleSettings. 2020-10-08 18:19:09 +02:00
51e43f27fa DNA: cleanup endian switching when loading file
This patch "modernizes" `DNA_struct_switch_endian` similar to
how I updated `DNA_struct_reconstruct` recently. Furthermore,
some special case handling have been moved to another place.

Reviewers: campbellbarton

Differential Revision: https://developer.blender.org/D9089
2020-10-08 18:17:12 +02:00
f23bf4cb10 Revert "BGL: Workaround broken bgl usage caused by GPU refactor"
This reverts commit f12b0373f3.
2020-10-08 17:58:38 +02:00
Rahul Chaudhary
479dc766b5 UI: Add icons for new sculpt trim tools
This patch adds missing icons for the new trim tools in sculpt mode.
Although these tools recently got "add geometry" modes, it's more
essential to highlight the most important feature of the tool,
trimming, than to try to portray everything they can do.

Differential Revision: https://developer.blender.org/D8963
2020-10-08 10:37:46 -05:00
8f798afbdd Cleanup/refactor: move init of MovieClip to proper place. 2020-10-08 17:19:05 +02:00
d3ba60b132 Add DNA defaults for MovieClip. 2020-10-08 17:19:05 +02:00
Rahul Chaudhary
0eb9027987 UI: Add icons for new face set tools
This patch adds missing icons for the new sculpt face set tools, and
updates the mask icons to be more consistent with the changes.

Currently draw face sets and draw mask icons are inconsistent and don't
relate to drawing/painting masks or face sets. This commit makes the
icons consistent and reusable for future tools like sculpt vertex
colors.

Differential Revision: https://developer.blender.org/D8875
2020-10-08 09:50:03 -05:00
f12b0373f3 BGL: Workaround broken bgl usage caused by GPU refactor
This directly adress the issues caused by rB536c2e0ec916.

Since the state tracking is done at a lower level, using the bgl
functions needs to be safegarded by the state manager.
The current workaround is to bypass `apply_state` when inside a
callback that used a `bgl` function.

Related to T80730.

This fix T81003.

Also this fix the default blend equation for callbacks.
Fixes T80169 T81289.
2020-10-08 16:36:17 +02:00
5f364216ac Cleanup/Refactor: Shapekey: Get rid of BKE_key_copy_nolib()
Once again, no behavioral change expected here.
2020-10-08 16:25:34 +02:00
d7f482f88e CMake/macOS: Avoid passing compiler flags to try_compile.
`APPLE` platform handles ASan compiler and linker flags using
`add_compile_options` and `add_link_options`. {rB74bcb32c9f02}

Arguments in `CMAKE_{LANG}_FLAGS{_CONFIG}` are also passed to
`try_compile` which will fail due to linker errors, since link flags
are not set. `try_compile` is used by `find_package(Boost)` for
`thread` library.

See CMP0066 [1] also.

[1] https://cmake.org/cmake/help/latest/policy/CMP0066.html

Ref D8855
2020-10-08 19:50:43 +05:30
4ee1332bdf Fix T79615: UI: icons and widget emboss look different from earlier versions
Both the default theme and Blender Light have been updated.

Blender Light also includes automatically generated colors based on the
default theme that were not set previously.
2020-10-08 16:17:31 +02:00
70a8498cec Cleanup/refactor: move init of Collection to proper place. 2020-10-08 16:11:56 +02:00
e900f6ed14 Add DNA defaults for Collection. 2020-10-08 16:11:38 +02:00
ef0ef8bcff Hair: Remove warning about undo when Delete Edit
Deleting the particle editmode is fully supported by undo now.
No need to warn the user about that anymore.
2020-10-08 15:00:35 +02:00
b46e828b0c Cleanup/refactor: move default init of armature to proper place. 2020-10-08 13:23:30 +02:00
cbbdfe24af Armature: Add minimal DNA defaults for bArmature.
Using mainly values used in `BKE_armature_add()`.
2020-10-08 13:23:30 +02:00
Andreas Bergmeier
c290e4cbe6 Cleanup: remove unnecessary includes
Differential Revision: https://developer.blender.org/D9148
2020-10-08 12:55:52 +02:00
1cf5ce5e25 Cleanup/refactor: BKE_libblock_alloc -> BKE_id_new in ID creation code.
Better use higher-level code from common ID management when possible.
Helps to de-duplicate logic, and reduces outside usages of more
'dangerous' functions.

Note that we could get rid of many of those `BKE_<id_type>_add`
functions now, but on the other hand several of those take extra
parameters and perform additional actions, so think we can keep them all
for now as 'non-standard ID specific creation functions'.
2020-10-08 12:50:04 +02:00
df5fe9718b Cleanup: Remove BKE_mask_copy_nolib() and BKE_mask_free().
Generic ID management code can now do those local temp copy handling, so
no need for duplicated own code for that.

No behavioral changes expected here.
2020-10-08 11:40:55 +02:00
fdb2240e4d Fluid: Fix particle helper grid export
Only export helper levelset and velocity (belonging to previous state) at the beginning of an (adaptive) frame.
2020-10-08 10:25:32 +02:00
e1900ddcfa Cleanup: use '_' prefix for internal bpy.ops variables
Even though these weren't included in __dir__, they are still accessible
from `vars(bpy.ops)`, use '_' to hint they are private.
2020-10-08 17:55:17 +11:00
79840abf6d PyAPI: use real modules for bpy.ops
Python 3.7x added support for module `__getattr__` & `__dir__`.

Make use of this for operator access,
previously these were module like classes.

No functional changes, this is mostly to use a type which is expected,
rather than faking the type with a class instance.
2020-10-08 17:45:50 +11:00
fb20efae59 PyDoc: fix most of the sphinx-build warnings
Use `.. currentmodule::` instead of `.. module::` for `bpy.types` and
`bpy.ops`. This change fixes most of the errors.

Ref D9139
2020-10-08 16:27:42 +11:00
d37fccab26 Cycles: fix UpdateTimeStats::clear() not resetting total times to zero 2020-10-08 06:41:33 +02:00
0b4aeffda9 PyDoc: support building without sphinx_rtd_theme
This is no longer bundled with sphinx, support building without it.
2020-10-08 12:32:50 +11:00
9c8334acc1 UI: Fix alignment in object type visibility popover
After rBeb911610d05 there are some differences in how the layout code
decides whether to add decorators (aka animation buttons). Whether or
not that logic is correct, it's nice to specify that we don't want them
turned on in this popover.
2020-10-07 19:48:45 -05:00
05d637280c Fix recent update to sphinx_doc_gen.sh
2f1a0f6f0e copied Makefile syntax into a
shell script. Use sphinx-builds 'auto' command to set the number of
jobs to run.
2020-10-08 11:08:36 +11:00
168ab643a5 Cleanup: use doxy sections for fmodifier.c 2020-10-08 10:53:05 +11:00
d8fcd8a316 Fix sculpt raycast function returning wrong value
When sampled normals were disabled SCULPT_cursor_geometry_info_update
was returning false instead of the value from the raycast data.
2020-10-07 23:43:40 +02:00
c4a281e801 PyDoc: Use explicit class names to refence class
This fixes the link and makes it more clear which class the note is 
talking about
2020-10-07 17:25:19 -04:00
d88da4db67 PyDoc: Render in text class name using class link syntax 2020-10-07 17:00:57 -04:00
b8f25dd698 PyDoc: Fix typo in extern audaspace documentation
A PR has also been sent upstream:
https://github.com/neXyon/audaspace/pull/33
2020-10-07 16:17:22 -04:00
021b94f27c PyDoc: Fix sphinx warnign from missing newline 2020-10-07 15:51:29 -04:00
3c045923a2 Cleanup: Remove redundant if-condition 2020-10-07 15:38:20 -03:00
833066088e Fix T81480: Input 0 to scale in redo panel resets to 1
Checking if `t->values[i] != 0.0f;` is not the best solution for all
transform cases.
2020-10-07 14:31:25 -03:00
fec5c12ac8 Cleanup: inconsistent parameter name
Found by clang-tidy.
2020-10-07 18:13:14 +02:00
253dbe71dc Refactor: remove BKE_<id_type>_copy functions.
Those were only shallow wrappers around `BKE_id_copy`, barely used (even
fully unused in some cases), and we want to get rid of those ID-specific
helpers for the common ID management tasks. Also prevents weird custom
behaviors (like `BKE_object_copy`, who was the only basic ID copy
function to reset user count of the new copy to zero).

Part of 71219.
2020-10-07 18:05:06 +02:00
03ef0cfe3c Refactor BKE_id_copy to return the new ID pointer.
No reasons to keep the new ID pointer as parameter here.

Part of T71219.
2020-10-07 18:05:06 +02:00
7c9131d11e Refactor BKE_id_copy_ex to return the new ID pointer.
Note that possibility to pass the new ID pointer as parameter was kept,
as this is needed for some rather specific cases (like in depsgraph/COW,
when copying into already allocated memory).

Part of T71219.
2020-10-07 18:05:06 +02:00
1f50beb9f2 Volumes: new Volume Displace modifier
This modifier uses a 3D texture to displace a volume.
For now, this can only use the previously existing texture system,
because we do not have a better alternative yet. Still, the results
can be quite good and interesting. See D9075 for some examples.

Reviewers: brecht, simonthommes

Differential Revision: https://developer.blender.org/D9075
2020-10-07 18:04:19 +02:00
b8638b6491 UI: Fix Incorrect Workspace Tab Sizing
Changes Workspace tabs so that the text size and tab width are both set by style.widget.points.

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

Reviewed by Julian Eisel
2020-10-07 08:59:13 -07:00
5e2a60a003 Fix T81171: Show Alerts at Center in Statusbar
Move position of Alerts and Progress bar back to the center of the Statusbar.

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

Reviewed by Brecht Van Lommel
2020-10-07 08:41:44 -07:00
Jeroen Bakker
7c373555fd Fix T81254: Incorrect calculation of EEVEE Transmittance Volumetrics
Regular rendering uses a custom blend mode, but render passes renders to
2 separate textures. This wasn't configured correctly inside the
fragment shaders. This patch adds a switch to configure the fragment
shader with the correct attachments.

Backport to Blender 2.83.

Reviewed By: Clément Foucault

Differential Revision: https://developer.blender.org/D9038
2020-10-07 17:26:37 +02:00
Jeroen Bakker
afab33e0b9 UV/Image Editor: Overlay Popover
The overlay options in the image/uv editor is hidden in side panels and menus. Sometimes this panel is even hidden, while still useful.
The goal of this task is to introduce an overlay pop-over just like the overlay-popover of the 3d viewport.

Popover has
* UV Stretching (only available in the UV mode, when active object mode is a mesh and in OB_EDIT mode)
* Display As (only available in the UV mode, when active object mode is a mesh and in OB_EDIT mode)
* Show Modified (only available in the UV mode, when active object mode is a mesh and in OB_EDIT mode)
* Show UV Edges (including opacity slider; available UV, View, Paint, when active object mode is a mesh and in OB_EDIT mode)
* Udim tiles when no image is available.

Like the 3d viewport, there will be a editor toggle to enable/disable the overlays

For compatibility reasons the RNA properties are added to both the `SpaceImage.uv_editor` amd `SpaceImage.overlay`. On DNA level they are still stored in the SpaceImage. only new properties are added to the SpaceImageOverlay struct. During the next major release we could remove these options from `SpaceImage.uv_editor`. This should be noted in the Python section of release notes.

Reviewed By: Julian Eisel, Pablo Vazquez

Differential Revision: https://developer.blender.org/D8890
2020-10-07 17:15:17 +02:00
fc767502dc Python API: add volume.grids.save(filepath) to save grids and metadata to disk
Particularly useful now that we can dynamically generate volume using
modifiers. Not exposed in the user interface currently, but it can be used
by add-ons that need to export an entire scene including volumes.
2020-10-07 17:11:09 +02:00
0ea4aab55e Fix T81490: GPencil merge layer duplicated all strokes
There was a wrong duplication of all strokes and this accumulated all previous data for each frame.

Also a cleanup has been done in order to clarify what means each variable.
2020-10-07 17:09:53 +02:00
2f1a0f6f0e PyDoc: Multithread sphinx-build
Compile times went from over 5min to under 2 on my laptop.
2020-10-07 10:25:46 -04:00
e748abda92 PyDoc: Remove workaround for slow sphinx builds
Tesing with newer versions of sphinx to directory `sphinx-build` is 
executed has no affect on the build time. Testing even gave a 2-3% speed 
boost.
2020-10-07 10:25:46 -04:00
e3a0e57542 CleanUp: DrawManager Balanced alloc/free of surface_per_mat cache
The alloc was done in the init, but the free was done in the discard.
As discarding can happen more often there were some unneeded if
statements to work around use after free.

This patch moves the free to the `mesh_batch_cache_clear` and removes
the if statements to check for use after free.
2020-10-07 16:18:12 +02:00
0796807720 CleanUp: Introduce eMeshBatchDirtyMode enum
It used to be an `int mode`.
2020-10-07 16:18:12 +02:00
Yevgeny Makarov
13391038a5 Fix / cleanup panel category tab drawing
The panel category tabs (In the 3D view N-panel) did not look great
when zoomed in or with high DPI screens, with multiple overlapping
outlines, and roundness that didn't match elsewhere in Blender. In
addition, there was some unecessarily low-level drawing code in the
panel code.

This commit uses an existing function `UI_draw_roundbox_4fv`to draw
the tabs instead. There are some slight visual differences, though
these are easily adjusted with theme colors.

Differential Revision: https://developer.blender.org/D9045
2020-10-07 08:53:59 -05:00
983ad4210b Fix T76595: Indicate the Active Keyframe in Graph Editor
In the graph editor there is a panel that says "Active Keyframe" for
numerically editing a keyframe's values, but in the code there is no
concept of the "active keyframe." Since this is a useful concept to
have for some other features anyway, this commit adds an active
keyframe index value to FCurves. It also displays it with a theme
color for the active vertex (which didn't exist before) if the
FCurve is active.

The active keyframe in the graph editor is treated similarly to the
active vertex in the 3D view. It is the keyframe most recently selected
with a single click, and it is always selected.

For now, the only real functional change is that the active keyframe
appears in white and it should be more predictable which keyframe is
being edited in the sidebar panel.

Differential Revision: https://developer.blender.org/D7737
2020-10-07 08:27:58 -05:00
ef235b0f17 Cleanup: improve integer types
Reviewers: mont29, brecht

Differential Revision: https://developer.blender.org/D9135
2020-10-07 15:24:12 +02:00
Yevgeny Makarov
1780f64dc3 UI: Improve labels in "Convert To" menu
Move the information about the type of the source objects to the item
descriptions instead of the names. The extra information in the names
made the labels cluttered, and it's less important information.

Differential Revision: https://developer.blender.org/D8352
2020-10-07 08:17:16 -05:00
Yevgeny Makarov
494ffd2f95 UI: Fix capitalization in various places
Follow the MLA style, agreed upon in T79589. This means "from" within UI
labels should be lowercase.

Differential Revision: https://developer.blender.org/D8345
2020-10-07 08:04:53 -05:00
Yevgeny Makarov
0fd06b535c UI: Use property split in various pop-up dialogs
The settings in these popups are not animateable, so also turn off
property decorate. And also use better widths in order to fit the
full text.

Differential Revision: https://developer.blender.org/D9060
2020-10-07 07:49:12 -05:00
Yevgeny Makarov
f948459f12 UI: Reduce item padding in the gpencil edit context menus
Aligning the columns removes unecessary white space.
The same as in the D8480 / rBb2e0c8f902fa.

Differential Revision: https://developer.blender.org/D9111
2020-10-07 07:40:34 -05:00
a81b059f1d Fix T79184: Specular highlight turns object black on some studio lights
This case was leaving some data uninitialized, producing some NaNs in the
fragment shader.
2020-10-07 14:09:08 +02:00
4ea3f3b316 GPU: Fix assert when using gpu workaround and SSS + light renderpass
This path makes use of more framebuffers when using the gpu workarounds.
Increase the MAX FBO attachments per texture. Maybe we could use a growing
vector in the future.
2020-10-07 14:09:08 +02:00
76b15e338a GPU: Avoid blit operation modifying the wrong framebuffer during restore
At the end of `GPU_framebuffer_blit` when `prev_fb->bind(true);` is called,
the `context_->active_fb` was not in sync and lead to the wrong framebuffer
being modified by bind function.

This fix T81055 SSS light is missing from the diffuse light render pass
2020-10-07 14:09:08 +02:00
724a4f4676 Fix T81226: Crash opening 64bit files with endian switching
Endian switching when loading 64bit blend files on a 64bit system was
crashing as the endian switching is only applicable when loading
on 32 bit systems.

This crash goes back to 2.7x, it looks like this never worked
all the way back to the first commit.
2020-10-07 21:56:10 +11:00
763cd94b6c Cleanup: Alembic, fix compiler warning about missing declaration
Mark the `has_animated_geom_params()` function as `static`, as it's only
used in that particular compilation unit.

No functional changes.
2020-10-07 12:41:55 +02:00
Christoph Lendenfeld
4a633fae8a Fix T67776: Animation/value keyframe slider doesn't appear in dope sheet
Avoid overwriting user-chosen `SACTION_SLIDERS` flag when switching the
Dope Sheet editor to Shape Key mode. The Shape Key mode now ignores the
flag, and always shows the sliders.

The obvious limitation is that you can't hide the sliders in the Shape
Key editor anymore

Reviewed By: looch, sybren

Differential Revision: https://developer.blender.org/D9121
2020-10-07 12:41:55 +02:00
65a6caafce IDTypeInfo: add flag to indicate that ID has no animation data
This is part of T75724.

Reviewers: mont29

Differential Revision: https://developer.blender.org/D9134
2020-10-07 12:35:58 +02:00
e2526e338f Cleanup: add comment 2020-10-07 11:14:38 +02:00
874cf52c10 Refactor: Remove BKE_XXX_localize(), in favor of using regular ID copying code.
Besides the NodeTree case (which remains unchanged), the localize code
is only used in one place (to generate previews of shading data-blocks).

This commit introduces a new `LIB_ID_CREATE_LOCAL` option for ID
creation/copying, which essentially implements the behavior of the
removed `BKE_XXX_localize()` functions into regular mainstream ID copy
code. When this option is set:
- new ID is tagged with `LIB_TAG_LOCALIZED`;
- Some ID copying callbacks have specific behaviors, mainly the root
  nodetree of shading IDs gets duplicated with specialized
  `ntreeLocalize()` function.

Note that I would not consider getting rid of `ntreeLocalize` for now,
this function is recursive, which should ideally never happen within ID
management copying code (this introduces all kind of complications).

No behavioral change expected from this commit.
2020-10-07 11:09:36 +02:00
94f91827f8 Cleanup: IDManagement: Localize: tweak to flags.
Add a specific flag for nodetree deep-copy special localization code.

And add a new `LIB_ID_CREATE_LOCALIZE` flag, similar to
`LIB_ID_COPY_LOCALIZE`, for creation purposes.

No behavioral changes expected here.
2020-10-07 11:09:36 +02:00
449e6124b5 Fix T81330: Alembic Import ignores constant meshes with animated vertex
colors

If the mesh was constant, no check was done if there were animated
vertex colors and thus creation of a MeshSequenceCache modifier was
skipped.

Thx @sybren for feedback!

Maniphest Tasks: T81330

Differential Revision: https://developer.blender.org/D9057
2020-10-07 10:56:48 +02:00
b7ca2365cf UI: Hide fade inactive geometry overlay settings for unsupported modes
If this doesnt work in a particular mode, it would be better to indicate
that in the Overlay popup.

Differential Revision: https://developer.blender.org/D8981
2020-10-07 10:26:32 +02:00
7f7efe78ce Silence CLOG error about usercount of deprecated IPO IDs. 2020-10-07 10:18:45 +02:00
5b97e50976 Fix T81272: Crash on opening old files where nodetrees had no name.
This code gets called before do_version can fix that, so we have to work
around it for now.
2020-10-07 10:18:45 +02:00
084d911010 Fix T81461: Weight paint crash with "Vertex Groups X Symmetry" option
In that case, weightpainting would still be done threaded, but current
mirroring code cannot be run in parallel.

Caused by rB5502517c3c12 [which was checking mesh 'flag', needs to be
'editflag' -- thus test was always true].

Reviewers: pablodp606

Maniphest Tasks: T81461

Differential Revision: https://developer.blender.org/D9126
2020-10-07 10:15:10 +02:00
099ce95ef3 UI: Add auto keyframing popover
For other areas in Blender that have a toggle and related settings,
we put a popover with the settings right next to the toggle. This
combination is nice because it organizes the settings without making
interaction slower. It also makes the settings more discoverable since
they're right next to the toggle.

Differential Revision: https://developer.blender.org/D8537
2020-10-06 15:17:36 -05:00
eb68cd713b Fix T81465: Snapping to edge center doesn't work as expected when using axis locking
The result was being affected by the view alignment correction.

Regression introduced in rB4eda60c2d82d
2020-10-06 16:20:01 -03:00
43ceea30f1 Fix T81488: Deleting an Object Constraint crashes Blender
The edit_constraint_property_get function was using bone constraints
in pose mode even for object constraints. This change mirrors the code
in `uiTemplateConstraints` as well.

Differential Revision: https://developer.blender.org/D9128
2020-10-06 13:07:36 -05:00
55fd7f55bd Fluid: Enable new flood-fill helper function
The flood-fill helper serves as a sanity check for scenes with complex obstacles. Similarly to the holes filler function it ensures that there are no holes in obstacles.

In addition, it ensures that there will be no holes resulting from multiple intersecting obstacles.

In general, this commit should improve stability.
2020-10-06 18:35:13 +02:00
a0ebfab4f3 Fluid: Updated Mantaflow source files
Among code cleanups, this update includes a new flood-fill helper function for levelsets.
2020-10-06 18:35:12 +02:00
2b72860ff4 Sculpt: Union and Join mode for trim tools
This enables a union boolean mode for the trimming gestures tools which
adds geometry to the mesh instead of cutting it.
It also adds a Join mode, which adds the geometry directly without
using a boolean operation.
Depending if you plan to use dyntopo or not, it is useful to have both
options available.

This is using the full depth of the object from the camera view for the
depth of the geometry, but options for controlling the trimming depth in
all modes are going to be added in later patches

Reviewed By: mont29

Differential Revision: https://developer.blender.org/D9066
2020-10-06 18:08:25 +02:00
d43e3f34d2 Fix T81218: Crash in pose mode using a driver on bendy bone Segment
The example file in T81218 has a driver that maps a bone's X-location to
the number of BBone segments. This caused a dependency cycle, which
resulted in bad thread serialisation, which caused the crash.

This patch breaks the dependency cycle `BONE_LOCAL` →
`DRIVER(bones["Bone"].bbone_segments)` → `BONE_LOCAL`. The 'Driver Data'
relation now points to `BONE_SEGMENTS` when the driven property starts
with `bbone_`.

Differential Revision: https://developer.blender.org/D9122
2020-10-06 17:49:57 +02:00
a2b1842358 Batch previews: improve speed of preview generation.
Force multi-threading of preview renders by setting appropriate tile
sizes (by default it would typically render on one or two threads only).
2020-10-06 16:52:09 +02:00
4bb15c8eec VSE: Fix audio strips
When sequencer was moved from kernel, the DEFINES based on audaspace
were not moved along.

That means users had no way of creating new audio strips since
BKE_sequencer_add_sound_strip was ifdef'out
2020-10-06 14:09:47 +02:00
f3fce877b3 Cleanup: Depsgraph, reduce nesting of driver relations code
Reduce nesting of `DepsgraphRelationBuilder::build_driver_data()` by
flipping conditions and `return`/`continue` early.

No functional changes.
2020-10-06 13:47:57 +02:00
1b9de4fa33 BLI: escape double quotes in dot export 2020-10-06 13:35:12 +02:00
6e7617211b UI messages fixes... 2020-10-06 10:38:21 +02:00
7d0139f417 Fix T81459: Memory Leak Cycles Rendered Viewport
The external engine in the draw manager wasn't registered correctly.
This did not free the resources after the external engine was used.
2020-10-06 08:33:42 +02:00
3178dc25f6 Fix T81470: Buttons in closed panel visible during search
The buttons hide when the search finishes based on whether they are in
the "panel header" group. These buttons were not protected with a new
group. This adds a new group for operator button calls, and also makes
it so a new group is always created after the header buttons.
2020-10-05 16:23:21 -05:00
7951312d4b API Doc Gen: Do not ignore objects file
This is used by the Blender manual or other sphinx website that would 
like to link to Blender's API documentation.
2020-10-05 16:26:40 -04:00
ff89d101e7 UI: Changes to Viewport Display UI of Volume Object and Fluid
- Density, interpolation and slicing options in Volume Object's
  Viewport Display are now not aligned to each other as they are not
  closely related.
- Changed the enum property for slicing ('Method') to a boolean
  property 'Slice' and added a sub-panel for slicing options under
  the 'Viewport Display' panel in Volume Object and Fluid for better
  clarity.
- Renamed `axis_slice_method` to `use_slice` in the python API for
  Volume Object and Fluid.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D9097
2020-10-05 23:12:48 +05:30
ffd4601447 Sculpt: Remove mask datalayer after extracting the object
When extracting a mask, the new object is going to have the same mask on
the same vertices, so it can't be sculpted without clearing the mask
first. It makes more sense to delete the mask datalayer from the new
object.

Reviewed By: mont29

Differential Revision: https://developer.blender.org/D9070
2020-10-05 19:38:08 +02:00
e1e061384b Fix T81343: Smooth shading normals not updating with line project tool
Just a missing update flag

Reviewed By: mont29

Maniphest Tasks: T81343

Differential Revision: https://developer.blender.org/D9077
2020-10-05 19:37:05 +02:00
a2b517cb11 Sculpt: Modify damping using the simulation factor of the cloth brush
This helps blending artifacts with dynamic simulation areas as the
damping increases when the vertex.

Reviewed By: mont29

Differential Revision: https://developer.blender.org/D9084
2020-10-05 19:36:14 +02:00
628dc91c48 Sculpt: Preview the active side of the line gestures
This adds a small gradient to the right side of the line to preview
which side of the mesh is going to be affected by the gesture operation.

Reviewed By: Severin

Differential Revision: https://developer.blender.org/D9106
2020-10-05 19:35:11 +02:00
ca38bce46a Fix T81380: Playback set start/endframe operators can set negative
rendering range

The Allow Negative Frames option, introduced in rB21a2350248fd, allows
for negative frames, but this should only apply for playback and
animations, the rendering range should still be clamped to MINFRAME /
MAXFRAME, because rendering does not allow for negative frames. Preview
range should not be affected afaict (I am not aware of operators that
allow for rendering this range).

Maniphest Tasks: T81380

Differential Revision: https://developer.blender.org/D9112
2020-10-05 18:37:59 +02:00
8bce181b71 Outliner: Move collection exclude button to restrict columns
Move the collection exclude checkbox to be with the other restrict
buttons. This makes the button consistent with the other restrict
buttons, and it makes the visual hierarchy more clear with the contents
of a collection properly indented under the collection name, rather than
the collection icon.

Differential Revision: https://developer.blender.org/D8928
2020-10-05 08:50:33 -06:00
Piotr Ostrowski
eedd7b27f9 Fix T81392: subdivision surface poor shading without limit surface
When the limit surface is disabled OpenSubdiv generates a set of linear
patches which are only C0 continuous, not C1. This makes it impossible to
evaluate derivatives at vertices which, in this mode, are by definition put
at boundaries of patches. Normals are calculated from those derivatives.

Solution is to disable normal calculation and let it be done downstream, as
for other modifiers. This limitation is also the reason that non feature
adaptive subdivision is badly suited for GPU evaluation.

Differential Revision: https://developer.blender.org/D9103
2020-10-05 16:41:43 +02:00
0a0e88b645 Cleanup: Use short for properties editor tab list
Because the active context is stored as a short in DNA it's better
to use short in the code surrounding it. Also adjusted a comment
that reflected an incorrect assumption.
2020-10-05 09:31:32 -05:00
7f3fe5b45c GPencil: Fix unreported Layer SOLO mode broken
During the refactor, this feature was removed by error.

When this option is enabled, only the frames with a keyframe are displayed in Draw mode. This is used when fill an animation to paint only in the frames with real drawing.
2020-10-05 16:02:32 +02:00
54f248fa87 Transform: Use orientation of active object with Auto Constraint
Fix T81429.

This was an intentional change in rBc75a665c442e as it maintains the
same behavior as the constraint with or without modifier.

But from the user's PoV, it is better to keep the old behavior.

This makes drawing and behavior more intuitive.
2020-10-05 10:05:06 -03:00
3df90de6c2 Cycles: Add NanoVDB support for rendering volumes
NanoVDB is a platform-independent sparse volume data structure that makes it possible to
use OpenVDB volumes on the GPU. This patch uses it for volume rendering in Cycles,
replacing the previous usage of dense 3D textures.

Since it has a big impact on memory usage and performance and changes the OpenVDB
branch used for the rest of Blender as well, this is not enabled by default yet, which will
happen only after 2.82 was branched off. To enable it, build both dependencies and Blender
itself with the "WITH_NANOVDB" CMake option.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D8794
2020-10-05 15:03:30 +02:00
Henrik Dick
72e741ee62 Fix T80897: Complex solidify crash when special ngons are merged
This has serious performance implications as the additional check makes
it O(N^2) when there are a lot of merged vertices.
The goal is to move the merging to the weld modifier where it would
be much easier to optimize.

Ref D8946
2020-10-05 23:57:55 +11:00
Henrik Dick
a9dc3fbef8 Fix T80893: Complex solidify special case with singularity
Ref D8929
2020-10-05 23:56:44 +11:00
Henrik Dick
ad16b2c515 Fix T80895: Complex solidify compare edges by content
Even if the index of the edge is not equal the content can be equal
if it has been merged. So compare the content.

Ref D8931
2020-10-05 23:56:12 +11:00
Henrik Dick
35708db5d2 Modifiers: Use vertex group options for complex solidify flat faces
Ref D8945
2020-10-05 23:56:08 +11:00
Henrik Dick
1454865ebb Fix T80269: Match material offset in solidify modes
This commit to complex solidify swaps the side of the geometry which
is affected by the material offset when the normal flip option is
enabled. This matches simple solidify and is considered correct/useful.

Ref D8948
2020-10-05 23:56:02 +11:00
8b72d9cc15 Insert keyframes while preserving shape of curve
Apply the De Casteljau algorithm to split the Bèzier curve at the X
coordinate where the new key is inserted, and uses the result to update
both the newly inserted and surrounding handles.

For curves that use Auto keyframes this has been largely addressed by
the new algorithm from D2884. This commit extends this to non-auto
handles.

This code is heavily based on D3172 by Alexander Gavrilov (@angavrilov).

Manifest Task: https://developer.blender.org/T81353
2020-10-05 14:26:51 +02:00
dfbf868298 Initialize CLOG to fix crashing unit tests
Initialize CLOG in the blendfile-loading unit test superclass. Since
rB8683d4e88f2e CLOG is used by more areas in Blender, and without
initialisation it crashes.
2020-10-05 14:25:46 +02:00
Matt McClellan
1d985159ad Fix Cycles OpenCL failing when extension string is long
This can happen for Intel OpenCL, now support arbitrary string length.

Differential Revision: https://developer.blender.org/D9020
2020-10-05 14:04:06 +02:00
2bbaa8df59 CMake: include DNA_modifier_defaults.h 2020-10-05 23:01:56 +11:00
c129d78039 Fix building without OPENVDB 2020-10-05 23:01:56 +11:00
7e836bde11 Fix critical lens distortion bug in libmv after rB3a7d62cd1f5e.
Current libmv_modal_solver_test fails since rB3a7d62cd1f5e.

It appears that the issue is caused by the insertion of the new OFFSET_K4 parameter,
as, if camera intrinsics are not required to implement/use all of those deform
parameters, they absolutely have to keep order (values) matching those defined
in bundle.cc, otherwise `PackIntrinisicsIntoArray` and `UnpackIntrinsicsFromArray`
will mangle them around.
2020-10-05 11:47:32 +02:00
0026ca09de Revert "Volumes: make Mesh to Volume modifier independent of object transforms"
This reverts commit 66cd82a8d. This was based on a misunderstanding. We do want
to take into account transforms similar to other modifiers like booleans, to
support taking into account animated transforms, combining multiple meshes into
one volume, etc.
2020-10-05 11:20:59 +02:00
a4f8b2ad76 Volumes: more generic way to handle different openvdb types
Reviewers: brecht

Differential Revision: https://developer.blender.org/D9093
2020-10-05 10:29:34 +02:00
3e101759b1 Cleanup: remove arguments to ENDIF in CMake files
This is an old convention that hasn't been used
by Blender or CMake distributed Find* files for a long time.
2020-10-05 16:26:06 +11:00
6d630219ce Cleanup: Declare variables where initialized
Declaring variables where they are initialized and used makes their
scope much more explicit and it aids readility since types are visible.
This commit doesn't touch the ID template code since there is an
active patch in that area.
2020-10-04 22:44:19 -05:00
18d7aeacf2 Move sequencer sources from blenkernel
This is first step of refactoring task T77580.
Next step will be breaking up files into smaller ones.

Reviewed By: sergey, brecht

Differential Revision: https://developer.blender.org/D8492
2020-10-05 02:58:56 +02:00
c514357358 Fix T80397: Select Side not working correctly
Test for side on which strip is was incorrect.
2020-10-05 02:29:47 +02:00
d12ff69320 Rename eSpaceSeq_Proxy_RenderSize members
Remove word proxy from eSpaceSeq_Proxy_RenderSize members if proxy is
not used with that item. Otherwise this can be a bit confusing.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D8861
2020-10-05 02:24:51 +02:00
f375ec4986 Fix T80282: Playback start delayed with AV sync
If current frame is set to before start frame, with AV sync there is
delay when playback is started.

Tag scene with ID_RECALC_AUDIO_SEEK, so audio playback starts from
correct position.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D8809
2020-10-05 02:17:19 +02:00
f4f6fdc268 Cleanup: simplify tempdir_session_create
Remove the need for a temporary allocated path.
2020-10-05 10:07:59 +11:00
659f81f1cb Correct last commit (where_is_temp refactor)
Changes didn't account the case when mkdtemp failed.
Previously the copying the string wasn't needed in this case.
2020-10-05 09:43:57 +11:00
ffa7152626 Cleanup: refactor where_is_temp
Functionality was hard to follow as the meaning of fullname
depended on basename being NULL or not.

- where_is_temp is now only responsible for finding the temp directory.
- Split out tempdir_session_create into it's own function
  that wraps mkdtemp.
- Rename basename to tempdir, fullname to tempdir_session.
2020-10-05 03:04:43 +11:00
1fa6881037 Cleanup: remove outdated comment
Should have been removed in b36a05bb7e,
when Python was started after reading the preferences.
2020-10-05 01:56:29 +11:00
270fb4d82b Preferences: use the users temp directory in background mode
This choice was made when preferences were not read in background mode,
so the temp dir needed to be initialized with something.
See bc9848f7e6.

Now preferences are always read there is no reason to ignore this
particular preference in background mode.

Anyone wanting to do background renders that ignore their preferences
can run with factory startup.
2020-10-05 01:29:08 +11:00
af76063949 Cleanup: BKE_appdir store static values in a struct, clarify names
Avoid multiple static variables with odd names,
instead keep them all in one struct, expand their names for clarity.
2020-10-05 00:55:39 +11:00
16c4db122f Fix error in last commit printing NULL strings
While this works with GCC, printing NULL strings is undefined behavior.
2020-10-04 22:23:48 +11:00
8683d4e88f BKE_appdir: log details about path lookups
These were printf's, disabled by a define that could be uncommented.

Use logging since this can be useful when investigating any issue
with paths not being found at the expected location.

Without this any problem finding app-templates, Python's installation,
icons ... etc are quite difficult to troubleshoot especially on systems
without access to system-call tracing.

To use this run:
  blender --log "bke.appdir" --log-level 3
2020-10-04 22:15:18 +11:00
9d30fade3e Fix color-management ignoring the data-path command line value
Initialize ImBuf (and color-management) after passing arguments
that set environment variables such as `--env-system-datapath`

This also fixes a bug where BKE_appdir logging failed since it was
called before the `--log` argument was passed.

Add asserts so this doesn't happen again.
2020-10-04 22:15:07 +11:00
7456ac6e4b Cleanup: clarify names in appdir
- ver -> version.
- env -> env_path.
2020-10-04 22:12:26 +11:00
6f3a9031f7 Cleanup: BKE_appdir left paths set even when not found
Internally appdir functions would test if a path exists,
returning false if it doesn't, leaving the string set instead
of clearing it.

This is error prone as invalid paths could be used accidentally.

Since BKE_appdir_folder_id_user_notest & BKE_appdir_folder_id_version
depend on this, add a 'check_is_dir' argument so the path can be used
even when the directory can't be found.
2020-10-04 09:33:14 +11:00
d8c3ad6f98 Cleanup: Remove duplicated View2D pan polling logic
Same as 21fc4ae206, but for view panning this time. Also had to set the poll
callbacks still in this case.
2020-10-03 22:15:15 +02:00
806edf11ba Revert part of previous commit
The change to the `poll()` callback was actually incorrect. But also
reduandant, since the function is actually already executed in the operator.
2020-10-03 21:51:50 +02:00
9668fc582c Fix compile error when compiling with WITH_INPUT_NDOF after View2D changes
Actually, fixes compile error and an incorrect poll.

Caused by 21fc4ae206 and 3a1cf838ca.
The poll has to perfrom the `view_zoom_poll()` logic to ensure correct context.
2020-10-03 21:30:38 +02:00
05bf109b52 Fix error in previous commit... 2020-10-03 19:01:12 +02:00
27bcbf19ed Fix possible un-initialized variable use in UI code
Uncovered by a4aa94c41c. Before that, it would actually be a possible `NULL`
pointer dereference.

It would happen if a `UILayout.prop()` was placed with the `full_event` option
set to `True` (or the C equivalent) for a non keymap-item property.
Now this the `full_event` option is ignored then with a warning print.
2020-10-03 18:56:19 +02:00
3a1cf838ca Fix issues with calling View2D zoom operators in an EXEC context
Multiple related issues:
* `view_zoomdrag_exec()` required `view_zoomdrag_init()` to be called first to
  set up data. Can now easily be done in the `_exec()` function as well though.
* Because of that the operators could not be called in an `EXEC_` context (e.g.
  `EXEC_REGION_WIN`).
* With "Zoom to Mouse Position" enabled, zooming from a menu or script would
  zoom to the mouse position. That should only happen if the operators are
  called directly in the editor.
2020-10-03 18:34:23 +02:00
eacaebea83 Cleanup: Remove redundant View2D operator poll check
The poll would already be executed as operator callback, this check was
redundant. Also see previous commit.
2020-10-03 18:34:23 +02:00
21fc4ae206 Cleanup: Remove duplicated View2D zoom polling logic
`view_zoomdrag_init()` would perform a number of sanity checks that
`view_zoom_poll()` already executed. The design of operators forsees that
(non-expensive) context sanity checks are done by the `poll()` callbacks, and
the execution callbacks can then just assume that happened. No reason to be
overly pedantic, we don't do that elsewhere either.

Note that this code is from the earliest days of an operator design. So it's
not surprising that it wasn't using the design "properly".
2020-10-03 18:34:23 +02:00
cb6234fccf Property Search: Set panel expansion when tab changes
This commit makes the panel expansion set based on the search results
when the active tab in the properties editor changes. The multi-tab
search patch (D8859) actually doesn't handle this because it uses a
different code path.

This feature uncovered a subtle but fairly significant issue with the
implementation of property search (More details in T81113). Basically,
the search needed multiple redraws to properly display the expansion of
panels based on the search results. Because there is no animation of
panel expansion when switching tabs, the problem was exposed only now.

With this commit, hiding of "search only" buttons and panel size
calculation happens in a single final step of the panel layout pass.
The "search only" layout root flag is removed. Instead every button
inside a panel header is in a single "uiButtonGroup" marked with a
specific "in header" flag, an idea which could be generalized in the
future.

Differential Revision: https://developer.blender.org/D9006
2020-10-03 11:25:13 -05:00
724370b2f9 Cleanup: use BLI_path_join in appdir.c to simplify logic
Change `test_path` function so:

- Joining paths calls a function instead of being performed inline.
- Optional NULL paths must always be ordered last (easier to follow).

Other minor changes:

- Remove FIXME comment is it's handled properly by BLI_path_join.
- The wrong size was being used copying into `targetpath`.
2020-10-04 00:45:35 +10:00
0bae2662f4 Cleanup: Remove/replace C standard library assert() and header usages
We have our own assert implementation, `BLI_assert()` that is prefered over the
C standard library one. Its output is more consistent across compilers and
makes termination on assert failure optional (through `WITH_ASSERT_ABORT`).

In many places we'd include the C library header without ever accessing it.
2020-10-03 16:10:15 +02:00
e839179b01 Cleanup: Remove dead code in panel logic
The region types checked here were removed from the editors in 9e2abbc9ba and
eb7485389b. So the if-conditions would never be true.
2020-10-03 14:44:31 +02:00
0bf12cb025 Fix error in recent change "run UserDef versioning from readfile.c"
Missed moving the defines in CMake for e255040c77
causing cycles not to be enabled.
2020-10-03 21:55:25 +10:00
44397a683c Cleanup: use doxy sections for appdir.c
Keep related functionality grouped.
2020-10-03 21:12:52 +10:00
f29e9e0d3c Cleanup: comments for appdir
Use doxy syntax & minor improvements.
2020-10-03 21:09:44 +10:00
6b7cbd6493 GPencil: Fix unreported wrong name for RNA setter
The Vertex Group setter function name was wrong for Tint modifier.
2020-10-03 10:59:09 +02:00
0863ae0a58 Cleanup: move temp directory environment checks into a loop
Minimizes ifdef'd code for WIN32.
2020-10-03 18:50:42 +10:00
cacd84a318 Fix invalid temp-dir for image-project on unsaved files
The preferences tempdir being used instead of bpy.app.tempdir.
2020-10-03 18:50:42 +10:00
9b602a8020 Preferences: remove temp directory initialization for WIN32
Revert 76b1a27f96 since there is no
reason windows should behave differently to other platforms.

This was added so Windows users wouldn't see "/tmp/" in the UI.

Since then the default temporary directory is a blank string,
leave blank on all systems as Python script authors may accidentally
use this instead of `bpy.app.tempdir`.
2020-10-03 18:50:35 +10:00
10ae2ea4ae Cleanup: remove unused temp directory initialization
This last worked in v2.27 (2003) where all paths were initialized to "/"
which was still checked to initialize the temp directory.

This hasn't been the case since 932e9e8316
where it changed to "/tmp/", then an empty string (current default).
2020-10-03 18:49:15 +10:00
29a85682a0 Fix stack use after scope error after recent cleanup
An error adding search to an existing button,
caused by my own error in rBa4aa94c41cb79e9.
2020-10-02 21:24:09 -05:00
743eca0f31 UI: Create button group if none exists
This makes it unecessary to create a button group when the block
is created, giving more flexibility when creating the first group-- for
example, creating the first button group with special parameters.
2020-10-02 17:11:44 -05:00
3eab2248c3 UI: Move button groups from layout to block level
For a future patch (D9006) we need these groups for longer than just the
the layout process, in order to differentiate buttons in panel headers.
It may also be helpful in the future to have a way to access related
buttons added in the same uiLayout.prop call. With this commit, the
groups are stored in and destructed with the uiBlock.
2020-10-02 17:00:56 -05:00
28a2c84948 Cleanup: remove unused code in blend file loading
v2.4x could cancel loading files that warned of being a newer,
unsupported version.

Remove this logic since it's no longer in use.
2020-10-03 07:25:36 +10:00
8cd8b3e9bd readfile: always run setup_app_data after updating defaults
When blend files were loaded with app-templates,
setup_app_data was running before defaults were updated.

This is likely to cause problems with order of initialization
so always update the startup file beforehand.
2020-10-03 07:25:36 +10:00
b13459f9e5 Cleanup: rename main preferences versioning function
BLO_version_defaults_userpref_blend -> blo_do_versions_userdef

The name was misleading as it was declared along with
BLO_update_defaults_startup_blend making it seem these functions were
related.

In fact preference defaults don't need to be updated as is done for
startup.blend since an in-memory blend file isn't used.

Rename the function to match other versioning functions
called from readfile.c. Also add/update comments on these differences.
2020-10-03 07:25:36 +10:00
e255040c77 Cleanup: run UserDef versioning from readfile.c
Now versioning UserDef is run in readfile.c,
as is done for other Blender data.

Previously versioning was mixed with other run-time initialization,
so it needed to be called later by the window manager.
2020-10-03 07:25:36 +10:00
15a9579a03 Cleanup: centralize versioning
readfile.c's versioning function was only used for 2 variables.
Move versioning into versioning_userdef.c so everything
is done in one function.

Note: DNA_struct_elem_find checks have been replaced with checks for
the next released version.
This is harmless, as only old preferences saved between releases can
have their values overwritten.

Note: userdef versioning should be called from `do_versions_userdef`,
this will be done separately.
2020-10-03 07:25:36 +10:00
a03bd6460c Property Search: Don't use search color for subpanel titles
This replaces the blue theme color for subpanel titles with the the same
fade as for parent panels.

The search color doesn't work well for subpanel title colors. And actually,
because there are often buttons with checkboxes in the panel headers, we
don't have to treat this indicator any differently than regular buttons.

Differential Revision: https://developer.blender.org/D8976
2020-10-02 13:14:33 -05:00
933bf62a61 Property Search: Differentiate search filtered and inactive buttons
Currently there's no way to know if a button is inactive when it doesn't
match the search results, because they use the same 50% gray level.

This isn't a huge problem, but it could lead to confusion. This commit
uses a subtle solution, a 25% opacity when the button is inactive and
 also filtered by search.

This requires flipping the meaning of the UI_SEARCH_FILTER_MATCHES
flag in the code, and also adding a widget_alpha_factor utility in
the widget code.

Differential Revision: https://developer.blender.org/D8975
2020-10-02 13:10:21 -05:00
6f96dd8576 Fix T78503: Disabled layout portion passes mouse through
3D Viewport -> Sidebar -> View -> Local Camera is disabled. When you
click on it, box select starts. This behavior isn't intended, and fixing
it is quite simple. The only case where this would continuing would
still be desired is if a disabled button overlapped with a non-disabled
button, but this shouldn't be the case anywhere.

Differential Revision: https://developer.blender.org/D8832
2020-10-02 13:06:58 -05:00
a4aa94c41c Cleanup: Declare variables where initialized
Also reduce the scope of some variable declarations.
This also allows making some variables constant.
2020-10-02 13:02:30 -05:00
6b32de4d9f Cleanup: Fix build error on windows
int and eContextResult are different types to MSVC
leading to a function signature mismatch.
2020-10-02 11:47:44 -06:00
38cdc7bcc1 Fix non-thread safe code in view layer object hash
Found as part of D8324, multithreaded Cycles object sync, where it caused
a crash on concurrent access to object holdout state.
2020-10-02 19:42:20 +02:00
350ed861f1 Cleanup: clang-format 2020-10-02 19:31:55 +02:00
cfa101c228 Cycles: Add command line option for overriding the compute device
The current way of setting the compute device makes sense for local
use, but for headless rendering it it a massive pain to get Cycles
to use the correct device, usually involving entire Python scripts.

Therefore, this patch adds a simple command-line option to Blender
for specifying the type of device that should be used. If the option
is present, the settings in the user preferences and the scene are
ignored, and instead all devices matching the specified type are used.

Differential Revision: https://developer.blender.org/D9086
2020-10-02 19:26:35 +02:00
90a27d5aa9 Cleanup: Use enum for return values in context callbacks
Define enum `eContextResult` and use its values for returns, instead of
just returning 1, 0, or -1 (and always having some comment that explains
what -1 means).

This also cleans up the mixup between returning `0` and `false`, and `1`
and `true`. An inconsistency was discovered during this cleanup, and
marked with `TODO(sybren)`. It's not fixed here, as it would consititute
a functional change.

The enum isn't used everywhere, as enums in C and C++ can have different
storage sizes. To prevent issues, callback functions are still declared
as returning`int`. To at least make things easier to understand for
humans, I marked those with `int /*eContextResult*/`.

This is a followup of D9090, and is intended to unify how context
callbacks return values. This will make it easier to extend the approach
in D9090 to those functions.

No functional changes.

Differential Revision: https://developer.blender.org/D9095
2020-10-02 18:56:25 +02:00
0db98b214d Fix T81345: part four, fix handling of IDProperties in edit armature undo.
Specific armature editing undo code would duplicate and store a list of
editbones. However, those are not linked to main data storage and should
therefore never affect ID usercounting.
2020-10-02 17:40:51 +02:00
4b36552967 Fix T81345: part three, armature free_data was not handling editbones properly.
Armature freeing would not correctly free its editbone IDProperties.

Add a utils to free the whole list of edit bones, and properly handle
their potential IDProperties.
2020-10-02 17:40:51 +02:00
f393452394 Fix T81345, part two: crash in depsgraph when freeing COW armature.
Freeing of bones' IDproerties from Armature `free_data` callback would always
attempt to do user refcounting, which should never be done from that code.

This would generate crashes in depsgraph/COW context e.g.
2020-10-02 17:40:51 +02:00
619e52eb82 Fix T81345: Part one: Missing handling of ID pointers from EditBone IDProperties.
So far data management code would simply fully ignore potential ID
pointers in custom properties of edit bones (which are a copy of those
from regular `Bone`). This would lead to all kind of issues, among which
refcounting inconsistencies, missing clearing of data uppon deletion,
etc.
2020-10-02 17:40:51 +02:00
5fc992e76a Cleanup: Move EditBone structure definition from ED to BKE area.
Access to this structure will be needed in BKE's armature code.
2020-10-02 17:40:51 +02:00
e3b49bb850 Fix T81200: Crash on certain armature select operators when OpenGL Depth
Picking is disabled

Affected were (at least)
- Select Linked pick
- Select Shortest Path

Was originally caused by rB8b347fc2cdc6 [which got improved in
rBfc8a7a44b200 - but only partially].

After removal of BONESEL_NOSEL we have to filter out -1 from the hits for
any bone picking it seems (since armature drawing uses this).
In rBfc8a7a44b200, this was done for 'ED_armature_edit_select_pick' (or
'get_nearest_editbonepoint' precisely), now do this for
'ed_armature_pick_bone_impl' as well.

Reviewers: campbellbarton

Maniphest Tasks: T81200

Differential Revision: https://developer.blender.org/D9080
2020-10-02 17:05:03 +02:00
8157305869 UI: Improve UV sticky select mode description
The sticky_select_mode property is an enum where each item has a
different behavior, but currently the description is for a single one
of the items. It should be more general, especially because one of the
items is "Disabled."

A couple more problems:
 - "Automatically" is not so helpful. Many things any program does are
   "automatic", it doesn't really help to say it.
 - "Also" is bad grammar.
 - Overly complex wording

This also adjusts the SHARED_VERTEX tooltip, because "irrespective"
should have "of" after, but it's also unecessarily complex.

Differential Revision: https://developer.blender.org/D9049
2020-10-02 09:17:40 -05:00
c65c4149c9 Cleanup: Refactor ed_screen_context() to use hash lookups
Refactor `ed_screen_context()` to use `GHash` lookups instead of a
sequence of string comparisons. This should provide a nice speedup,
given that the hash for `member` only has to be computed once instead of
matching it to each possible string.

Reviwed by: brecht

Differential Revision: https://developer.blender.org/D9090
2020-10-02 15:42:04 +02:00
ab72406dc3 Cleanup: split up ed_screen_context() into separate functions
Refactor `ed_screen_context()` to call separate functions, instead of
having the entire functionality in one function. Each function now only
retrieves the data it needs from the context. Furthermore, some string
comparisons are removed.

No functional changes.

Reviwed by: brecht

Differential Revision: https://developer.blender.org/D9090
2020-10-02 15:42:04 +02:00
66cd82a8d2 Volumes: make Mesh to Volume modifier independent of object transforms 2020-10-02 15:14:20 +02:00
74ea369830 Experimental Features: More robust way of sanitizing options 2020-10-02 14:05:13 +02:00
cb363953f0 Experimental Features: Sanitize missing (latest) options
There was an oversight when adding new experimental user preferences.
I can try to overengineer this later to make it more fail-proof. But for now
it should be clear what to update when adding a new variable.
2020-10-02 14:05:13 +02:00
92a0ec87a2 Experimental Features: Rename Image editor option
This prevents having multiple UI strings starting exactly the same:
* Legacy A...
* Legacy B ...
2020-10-02 14:05:13 +02:00
5476017d07 CleanUp: Remove header only definition
node_draw_link_straight existed in header files without a body
2020-10-02 13:23:40 +02:00
b5ad69832e Cleanup: reduce variable scopes 2020-10-02 13:05:08 +02:00
dd95a2e1d5 Cleanup: remove redundant theme versioning
All themes older than 2.8x are initialized from the defaults,
there is no need to version them.
2020-10-02 21:00:11 +10:00
d858859402 Cleanup: spelling
Also correct own correction from 58b8724a48
thanks @mont29 for raising this.
2020-10-02 20:41:03 +10:00
d1f6c2e7bb Fix userpref.blend using version from startup.blend
Version patching userpref.blend wasn't using the correct version,
causing settings not to be properly updated.

This seems the likely cause of T70196 and similar bugs.
2020-10-02 20:21:27 +10:00
34228d138b License: Rename GPL2 license to match the name specified in copyright.txt
The license was renamed GPL-license.txt => license/GPL-2.0txt in 0434efa09d.

Although the renaming made all the license files consistent, we are better off
not updating the copyright file in Blender. Instead we can live with some mild
inconsistency in the license names.
2020-10-02 12:18:02 +02:00
2b90dd1ac5 Fix (unreported) assert in texture code when loading some old 2.74 blend file.
Trying to open the 2.74 Fishy Cat file would generate endless asserts in
customdata code. This commit refactors and cleans up the code of
`psys_get_dupli_texture` to avoid useless calls and data access, and
validate data before trying to further access it.

No behavioral changes expected here (besides getting rid of the assert).
2020-10-02 11:47:35 +02:00
062dfab159 Cleanup: readfile for workspaces: NULLify non-owned data pointers.
`workspace_hook` of wmWindows store pointers for runtime data and to
data belonging to other IDs (workspace's layouts). That kind of pointers
should always be cleaned up on read, it allows for cleaner segfault
crash in case of mistakes in code updating/re-setting them, and avoids
potential security issue of accessing random memory address.

No behavioral change expected here.
2020-10-02 11:47:34 +02:00
6219d0d145 Fix (unreported) design flow in how workspace's relation data are read from .blend file.
Relying on pointer addresses across different data-blocks is extremely
not recommended (and should be strictly forbidden ideally), in
particular in direct_link step of blend file reading.
- It assumes a specific order in reading of data, which is not ensured
  in future, and is in any case a very bad, non explicit, hidden
  dependency on behaviors of other parts of the codebase.
- It is intrinsically unsafe (as in, it makes writing bad code and making
  mistakes easy, see e.g. fix in rB84b3f6e049b35f9).
- It makes advanced handling of data-blocks harder (thinking about
  partial undo code e.g., even though in this specific case it was not
  an issue as we do not re-read neither windowmanagers nor worspaces
  during undo).

New code uses windows' `winid` instead as 'anchor' to find again proper
workspace hook in windows at read time.

As a bonus, it will also cleanup the list of relations from any invalid
ones (afaict it was never done previously).

Differential Revision: https://developer.blender.org/D9073
2020-10-02 11:47:34 +02:00
d74d35e39e CleanUp: snode_group_offset -> space_node_group_offset 2020-10-02 11:46:01 +02:00
01698caa66 CleanUp: Renamed drawnodespace -> node_draw_space 2020-10-02 11:41:13 +02:00
63f525bae3 Fix text editor auto-complete refinement feature
Left/right arrow keys can refine the completion,
this wasn't redrawing and there was an off-by-one error checking
the next character.
2020-10-02 17:43:31 +10:00
09082e15d0 Fix text editor auto-complete mouse interaction
- Remove MMB for activating an auto-complete item (use LMB instead).
- Update on cursor motion.
2020-10-02 17:07:35 +10:00
4053fa9fcb Fix invalid version check in 'project_source_info'
Own error in 870fcb3857
2020-10-02 13:46:41 +10:00
6b1bbcd3b0 Cleanup: use raw-strings for regex in console completion 2020-10-02 11:59:16 +10:00
41d2d6da0c Cleanup: pep8 (indentation, spacing, long lines) 2020-10-02 11:59:16 +10:00
bab9de2a52 Cleanup: pep8, blank lines 2020-10-02 11:59:16 +10:00
28ebe827e6 Cleanup: trailing space 2020-10-02 11:59:16 +10:00
e2e31b9bac Cleanup: compiler warnings 2020-10-02 11:58:33 +10:00
edd1164575 Cycles: add time statistics to scene update
Gathers information for time spent in the various managers or object (Film, Camera, etc.) being updated in Scene::device_update.

The stats include the total time spent in the device_update methods as well as time spent in subroutines (e.g. bvh build, displacement, etc.).

This does not qualify as a full blown profiler, but is useful to identify potential bottleneck areas.

The stats can be enabled and printed by passing `--cycles-print-stats` on the command line to Cycles, or `-- --cycles-print-stats` to Blender.

Reviewed By: brecht

Maniphest Tasks: T79174

Differential Revision: https://developer.blender.org/D8596
2020-10-01 23:21:11 +02:00
342bdbc176 Fix warnings in cloth brush int casts
Use POINTER_AS_INT instead

Reviewed By: HooglyBoogly

Differential Revision: https://developer.blender.org/D9083
2020-10-01 20:47:22 +02:00
c3238bd500 Cleanup: Use DNA defaults for cloth modifier
Followup for rB8398050695
This requires moving a few enum definitions to DNA instead of BKE, and
adding default definitions for the two structs the cloth modifier where
the cloth modifier stores its settings. The defaults are also reordered
to be consistent with the order of each item in the struct.
2020-10-01 12:56:34 -05:00
4c0ef4f788 Cleanup: Clang tidy fixes
Fix a redundant return statement at the end of void function and
an inconsistent declaration parameter names.
2020-10-01 12:45:21 -05:00
Pablo Dobarro
b6f15d5d47 Fix T80873: Grab active vertex preview not working with shape keys
When a Shape Key is active, use the PBVH deformed coordinates for the
preview.

Reviewed By: sergey

Maniphest Tasks: T80873

Differential Revision: https://developer.blender.org/D8921
2020-10-01 19:24:12 +02:00
e41437b16e Fix T81268: Crash when undo from Sculpt Mode to Edit Mode
This was introduced in 6c9ec1c893. The overlays can now be drawn when
PBVH drawing is not enabled, but the PBVH should still exist in the
SculptSession in order to draw them. Before, it was avoiding the crash
by checking use_pbvh as BKE_sculptsession_use_pbvh_draw also checks if
the PBVH exists.

Reviewed By: sergey

Maniphest Tasks: T81268

Differential Revision: https://developer.blender.org/D9044
2020-10-01 19:18:22 +02:00
8fbb6aa4ec Paint: Ignore inbetween events for anchored strokes
When using anchored strokes, inbetween events are not needed since there
is no stroke path to be reconstructed. Handling the inbewteen events are
only producing unnecessary updates, creating performance issues.

Reviewed By: sergey, brecht

Differential Revision: https://developer.blender.org/D9053
2020-10-01 19:13:19 +02:00
Pablo Dobarro
8ef353fa50 Sculpt: Cloth Simulation Dynamic area mode
This simulation area mode moves the active area with the brush. When
enabled, the cloth brush has no restrictions on stroke length, area or
mesh vertex count.

In order to work, this enables PBVH nodes dynamically for simulation as
the stroke location moves and builds the constraints for new nodes
during the stroke. When a node is not inside the simulated area, all the
constraints that were created for it and vertex collisions are not
computed. The simulation limits falloff areas and constraints tweaking
control how the simulated and no simulated nodes blend.

Reviewed By: sergey, zeddb

Differential Revision: https://developer.blender.org/D8726
2020-10-01 19:11:45 +02:00
cd81c38688 Cleanup: typo in comment 2020-10-01 18:38:31 +02:00
84e122e38a Cycles: Fix broken 32 bit shift.
1ul << n will still be a 32 bit integer regardless
of the value of n, given the target here is 64 bits
the upper 32 bits will always be zero. Using 1ull
will yield the expected result.
2020-10-01 10:19:50 -06:00
ec723ad25c remove foreachObjectLink callback
This removes `foreachObjectLink` from `ModifierTypeInfo`, `GpencilModifierTypeInfo`
and `ShaderFxTypeInfo`. There is no need to have both, `foreachObjectLink` and `foreachIDLink`.
There is not code that actually depends on `foreachObjectLink`.

Reviewers: brecht

Differential Revision: https://developer.blender.org/D9078
2020-10-01 18:05:23 +02:00
cbbd5283a3 Cleanup: remove trailing whitespace 2020-10-01 17:59:04 +02:00
365bf103d1 Volumes: support lower resolution in viewport
The adds a new option to simplify volumes in the viewport.
The setting can be found in the Simplify panel in the render properties.

Volume objects use OpenVDB grids, which are sparse. For rendering,
we have to convert sparse grids to dense grids (for now). Those require
significantly more memory. Therefore, it's often a good idea to reduce
the resolution of volumes in the viewport.

Reviewers: brecht

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

Ref T73201.
2020-10-01 17:59:04 +02:00
5b8503425a Fix subdivision surface wrong for non-limit surface and subdivision level 1
Remove the workaround for T59395 that increases the minimal refinement to 2
to work around an OpenSubdiv bug. This bug appears to be fixed in the latest
OpenSubdiv version we are using.

Problem found by Piotr Ostrowski.

Ref D9076
2020-10-01 17:43:41 +02:00
958fc6944f Cleanup: make texture coordinates const 2020-10-01 16:57:00 +02:00
8398050695 Use DNA defaults system for modifiers
As noted in T80164, there are quite a few area of Blender where the
"Reset to Default Value" operator in button context menus doesn't work.
Modifiers are one of them, because the DNA defaults system was never
set up for them.

Additionally, this should make modifier versioning easier. Whenever a
new field is added it should be automatically initialized to the
default value.

I had to make some ordering changes in the following modifiers to work
around an error with `-Wsign-conversion` in the macros:
 - Solidify Modifier
 - Corrective Smooth Modifier
 - Screw Modifier

Some modifiers are special cases and are skipped in this commit:
 - Data Transfer Modifier
 - Cloth Modifier
 - Fluid Modifier
 - Softbody Modifier

Differential Revision: https://developer.blender.org/D8747
2020-10-01 09:38:00 -05:00
551204a17f Cleanup: Remove unused variable 2020-10-01 09:05:29 -05:00
d7af1c7bd9 Fix: Mesh to Volume modifier crashes when object is in edit mode
Bug and fix has been found by dfelinto, thanks.
2020-10-01 15:54:01 +02:00
5e6459ac1c Volumes: copy display settings in BKE_volume_new_for_eval 2020-10-01 15:54:01 +02:00
f79b4850fb Fix T81248: World nodetree action is linked after duplication
This was already changed for Material nodetrees on duplication in
rBa75ac18638f4.
Since it is not obvious from the UI how change World actions - and to be
consistent with Material actions, it is best to copy the action as the
default behavior.
So use generic BKE_id_copy functions with LIB_ID_COPY_ACTIONS flag [which
also enables us to get rid of `BKE_world_copy`]

Note: taking the User Preference `USER_DUP_ACT` into account here (for
both material and world actions) could be a followup step.

Maniphest Tasks: T81248

Differential Revision: https://developer.blender.org/D9046
2020-10-01 15:42:51 +02:00
91f061003c Fix T81267: bad handling of usercount for actions duplicated with some animdata.
Those actions are full proper IDs and should therefore not be affected
by flags used to duplicate 'owner' ID own data.
2020-10-01 15:03:31 +02:00
Martijn Versteegh
f117966c4e Fix T80395: Cycles baking crash when Surfaces are disabled in the view layer
Always enable surfaces for baking, otherwise there is nothing to bake to.

Differential Revision: https://developer.blender.org/D9015
2020-10-01 14:37:59 +02:00
2caa6dd7f8 Cleanup: clang-format 2020-10-01 14:29:45 +02:00
Ivan Perevala
5d824c4212 Fix missing UI elements for the new Brown-Conrady distortion model
Differential Revision: https://developer.blender.org/D9072
2020-10-01 14:25:20 +02:00
fd698782b9 Fx several issues with Outliner's collection editing re linked/override.
Most collection operations should not be allowed when either the scene
or the parent collection are linked or liboverrides.

This commit adds more stricter checks in both polling and execution
aspects of several related operators.

Fix T81282: Crash on instance to scene of a collection of a linked scene.
2020-10-01 14:11:55 +02:00
9f9dbaf22b Fix some inactive modifier properties not being editable
The convention is to keep inactive settings editable even if they are grayed
out for having no effect due to other settings.
2020-10-01 12:13:38 +02:00
Nicholas Rishel
f187256624 Windows: workaround to make Windows Ink tablet API work
Now Wintab is not initialized when starting Blender with the tablet API
preference set to native, since that disables Windows Ink.

Note that changing the tablet API requires restarting Blender for changes
to take effect. This serves as a stopgap to allow use of Windows Ink until
runtime API switching is merged.

Differential Revision: https://developer.blender.org/D9051
2020-10-01 12:05:36 +02:00
Yevgeny Makarov
bcc6baec24 macOS: support for key repeat events in keymaps
Differential Revision: https://developer.blender.org/D8882
2020-10-01 11:53:22 +02:00
63c906e0a7 Fix T81340: UBSan: addition of unsigned offset causes overflow
The warning:
runtime error: addition of unsigned offset to 0x61a0000b22d8
overflowed to 0x61a0000b22b8

Fix T81340 (partially)

Reviewed By: campbellbarton

Maniphest Tasks: T81340

Differential Revision: https://developer.blender.org/D9063
2020-10-01 14:26:45 +05:30
a4e14c3bfd Cleanup: avoid applying offset to null pointer
Based on D9069 by @ankitm.
2020-10-01 15:03:14 +10:00
Ankit Meel
99fb853734 Cleanup: avoid member access within null pointer
While harmless, UBSan warns about this.
Prefer offsetof where possible since it's more readable.
2020-10-01 14:49:44 +10:00
c1ae12bf5e Cleanup: dna_genfile API for accessing struct member offsets
- Rename `find_elem` to `elem_offset` (matching `elem_exists`).

- Remove unused `SDNA_StructMember` return argument.

- Return an offset instead of a pointer which was being converted
  back into an offset by one caller,
  in this case there was no way to tell the difference between
  and element that doesn't exist and a struct member
  at the start of the array.

Resolves UBSan warning raised in T81340.
2020-10-01 14:32:43 +10:00
2c317457cb Fix File Browser filtering showing workspaces for "Environment" category
This is not an appropriate category for workspaces.
Mistake in 7f564d74f9. My intention was probably to add it to the
"Miscellaneous" category.
2020-09-30 20:50:04 +02:00
2cc913d7d9 Fix implicit conversion from pointer to bool
Error in 9b6c5268bc. Also move variable declaration to where it's
used to reduce confusion.
2020-09-30 12:31:53 -05:00
8cbd09672d Cleanup: Remove unused View2D variables and function
It looks like this code was left over from tabbed panels in the
properties editor. It wasn't used anywhere except for in one line of
the horizontally-aligned panel code that was recently removed.

Differential Revision: https://developer.blender.org/D8651
2020-09-30 12:21:35 -05:00
65e4bfe2f0 Cleanup: Reduce indentation
Instead of indenting the entire functional block, check for the error
case and the supported case early to make the code more readable.
2020-09-30 12:16:46 -05:00
60e5ebdd62 Fix Cycles CUDA kernels for Ampere not building with CUDA 11
Running Blender on Ampere cards was already possible with ptx, this fix is
needed to support building CUDA binaries.

Note the CUDA version used for official Blender builds is still 10, this is
merely the change to make it possible for those using CUDA 11 and specifying
the sm_8x kernels to be compiled.

Found by Milan Jaros.
2020-09-30 18:29:42 +02:00
443e42d47c Subdivision Surfaces: make uv smooth items consistent with new boundary smooth
This adds an option to smooth UV boundaries including corners, and renames the
available options to None / Keep Corners / All.

Ref D8413
2020-09-30 17:20:29 +02:00
Piotr Ostrowski
6070f92ab9 Subdivision Surfaces: add boundary smooth option to modifiers
This adds the option to either smooth the entire boundary, or to keep
corners sharp, for the Subdivision Surface and Multiresolution modifiers.

This mainly helps with compatibility with other software. The default
behavior remains to smooth the entire boundary.

Differential Revision: https://developer.blender.org/D8485
2020-09-30 17:20:29 +02:00
Piotr Ostrowski
53f20b940a Subdivision Surfaces: add option disable using the limit surface
This makes subdivision surfaces compatible with the old subdivision
surface modifier and other applications that do not use the limit surface.

This option is available on the Subdivision Surface modifier.

Differential Revision: https://developer.blender.org/D8413
2020-09-30 16:39:02 +02:00
ecdfb465cc Cycles: Fix usage of memory barriers in split kernel
On user level this fixes dead-lock of OpenCL render on Intel Iris GPUs.
Note that this patch does not include change in the logic which allows
or disallows OpenCL platforms to be used, that will happen after the
kernel fix is known to be fine for the currently officially supported
platforms.

The dead-lock was caused by wrong usage of memory barriers: as per the
OpenCL specification the barrier is to be executed by the entire work
group. This means, that the following code is invalid:

  void foo() {
    if (some_condition) {
      return;
    }
    barrier(CLK_LOCAL_MEM_FENCE);
  }

  void bar() {
    foo();
  }

The Cycles code was mentioning this as an invalid code on CPU, while in
fact this is invalid as per specification. From the implementation side
this change removes the ifdefs around the CPU-only barrier logic, and
is implementing similar logic in the shader setup kernel.

Tested on NUC8i7HVK NUC.

The root cause of the dead-lock was identified by Max Dmitrichenko.

There is no measurable difference in performance of currently supported
OpenCL platforms.

Differential Revision: https://developer.blender.org/D9039
2020-09-30 16:10:35 +02:00
Ivan Perevala
3a7d62cd1f Tracking: Implement Brown-Conrady distortion model
Implemented Brown-Conrady lens distortion model with 4 radial and
2 tangential coefficients to improve compatibility with other software,
such as Agisoft Photoscan/Metashapes, 3DF Zephir, RealityCapture,
Bentley ContextCapture, Alisevision Meshroom(opensource).

Also older programs: Bundler, CPMVS.
In general terms, most photogrammetric software.

The new model is available under the distortion model menu in Lens
settings.

For tests and demos check the original patch.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D9037
2020-09-30 15:54:24 +02:00
Valentin
5ac4778056 Cleanup: convert gforge task ID's to phabricator format
Cleanup old tracker task format to the new. e.g: [#34039] to T34039

Ref D8718
2020-09-30 20:11:06 +10:00
c0a563ffe8 Cleanup: use 'use_' prefix for RNA booleans
Some of the naming was quite misleading.
2020-09-30 15:09:00 +10:00
Ivan Perevala
e9a6638654 UI: Motion Tracking: Fix description of K2 coefficient
Fixed description of K2 coefficient. It is second coefficient

Reviewed By: Blendify

Differential Revision: https://developer.blender.org/D9050
2020-09-29 23:01:16 -04:00
dbaa9291f2 Cleanup: spelling 2020-09-30 12:25:58 +10:00
e200e44c4e Cleanup: remove full-stop from description 2020-09-30 12:25:09 +10:00
0863316745 Cleanup: use angle-brackets for email addresses
This is already the most widely used convention.

Use this so `make check_spelling_c` will ignore all email addresses.
2020-09-30 12:05:56 +10:00
714f5078da Cleanup: sort cmake file lists 2020-09-30 11:51:42 +10:00
38a66903e5 Cleanup: sort struct declarations 2020-09-30 11:51:13 +10:00
e5aa9decb2 Cleanup: Make function private
The "UI_panel_set_expand_from_list_data" doesn't need to be in the
public API since it's just called every time an instanced panel is added.
This commit just sets the expansion automatically and adjusts some
naming to account for the moved function.
2020-09-29 17:41:00 -05:00
e1e9b5e661 Fix use after free deleting object with modifier panels visible
It's necessary to check if the panels are active before accessing their
data. Thanks to @ankitm for reporting this.
2020-09-29 17:19:57 -05:00
23363ca084 Cleanup: Use LISTBASE_FOREACH macro in outliner code 2020-09-29 17:08:32 -05:00
1b6480ebb7 UI: Remove second person in warning message
This phrasing can feel like an accusation, and a simpler phrase
gets across the idea just as well.
2020-09-29 16:21:58 -05:00
Pablo Dobarro
53804b333a Sculpt: Preserve Mesh visibility from edit mode using the Face Sets
Before this change, when users switch from edit mode to sculpt mode, the
entire mesh would be visible. Even if in the edit mesh mode part of it was
set to invisible.

With this change the visibility is preserved, by creating a separate face set
for the visible and invisible parts of the mesh and setting their initial visibility.

Implementation details: This adds a function to initialize a new Face Set
 datalayer taking the current mesh visibility into account which is stored
in the ME_HIDE flag of the vertices.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D8901
2020-09-29 22:54:36 +02:00
e0bfd3968c Sculpt: Line Project Gesture tool
This tool projects all vertices to the right of the plane defined by the
line gesture towards the plane. By doing this, this tool can create cuts
and plane surfaces in the mesh without modifying the geometry or using
boolean operations, so it is much faster than bisecting the mesh for
cases where the geometry was going to be remeshed afterwards.

Added as experimental as it does not have icon.

Reviewed By: sergey, Severin

Differential Revision: https://developer.blender.org/D9021
2020-09-29 22:48:05 +02:00
f855dc8ce9 API Docs: Correct syntax for bpy.utils.register_class 2020-09-29 16:45:29 -04:00
nutti
db346ac2cd API Docs: Fix corrupted document of gpu.select.load_id
The Python API document of gpu.select.load_id does not follow rst format.
c.f. https://docs.blender.org/api/current/gpu.select.html

This patch fixes it.

Reviewed By: Blendify

Differential Revision: https://developer.blender.org/D8547
2020-09-29 15:50:49 -04:00
7322b83cf2 API docs: Fix sytax error for delaunay_2d_cd
Alternative solution to https://developer.blender.org/D8546
2020-09-29 15:50:49 -04:00
Ankit Meel
c1cdde04e2 Fix T81100: ccl::Node: ASan SEGV due to bad pointer
`SOCKET_OFFSETOF` was added in the initial commit {rBec51175f1fd6c91d5}
when `offsetof` [1] was not supported well enough. GCC and LLVM
support it since C++17.

Other two changes: type and size check can be done without creating
an invalid address too.

[1] https://cppreference.com/w/cpp/types/offsetof

Reviewed By: campbellbarton, brecht

Maniphest Tasks: T81100

Differential Revision: https://developer.blender.org/D9042
2020-09-30 01:16:02 +05:30
4c3047a9cd API Docs: Use raises field list syntax
See 
https://www.sphinx-doc.org/en/master/usage/restructuredtext/domains.html#info-field-lists
2020-09-29 15:07:41 -04:00
ebf752625e Fix unreported Eisenbug leading to a crash when reading a blend file.
This took more than a day to fully investigate and understand, one of
the reasons being that the probability of the issue to show up was
extremely low, and subjected to very specific random factors.

Root of the issue is that, in some very rare cases, a newly read ID
might get the exact same memory address as the one it had when the blend
file was saved.

In that case, `BKE_workspace_active_set` would return immediately, since
the pointer to the active workspace would remain unchanged. But that
lead to having an unset NULL active layout pointer, which would crash
when attempting to get e.g. the active screen.

For the record, I ran into this when running a specific build (master
with one flag added to the `LIB_ID_CREATE` ones, with value `1 << 3`),
using a specific set of options (`--background --factory-startup -noaudio`),
and passing the .blend file from T80090 as argument.
2020-09-29 17:08:44 +02:00
84b3f6e049 Fix (unrepported) utterly broken logic in readfile for Workspaces.
Remove the attempt to update the active layout pointers of each window
from whithin `direct_link_workspace`.

This piece of code was a nonsense for at least to critical reasons:
* Do not, never, ever, access data from another datablock within the
  direct_link_... functions. Just don't. Don't try to be smart.
* Since it was trying (and failing) to update the active layout of every
  window for every workspace, it was effectively setting those
  `act_layout` pointers to NULL (remapping can only ever happen once,
  trying to remap and already remapped new pointer is bound to fail in
  any case).

Luckily (and funnily), this piece of code was actually harmless, since
setting the active layout would be overridden/redone later, in
`lib_link_windowmanager`, when updating their `workspace_hook` in
`lib_link_workspace_instance_hook`.

Note that the similar horror with `WorkSpaceDataRelation->parent` (which
points at a window) is kept for now, because that one is needed. Hope to
refactor it soon though.
2020-09-29 17:08:44 +02:00
ece8f69f85 Property Search: Set expansion properly for child panels
Although I haven't seen this cause any visible errors, there is some
incorrect handling for setting panel expansion during search:
 - Properly check if child panel is active first
 - Don't stop traversal at headerless panels that could theoretically
   have children
2020-09-29 09:33:48 -05:00
Sybren A. Stüvel
bab2260b59 Fix T71981: Alembic vertex interpolation can jumble mesh
Add an option to disable Alembic vertex interpolation.
Bump subversion from 5 to 6.

Alembic stores mesh samples at specific time keys; when a frame in
Blender maps to a timecode between two samples, Blender will interpolate
the mesh vertex positions. This interpolation only happens when the mesh
has a constant topology, but sometimes this was not detected properly
when the vertices change order, but the number of mesh elements remains
the same. This would result in a mesh with jumbled up vertices (T71981).
With this patch, users have the ability to disable vertex interpolation.

An alternative would be to have better detection of topology changes,
but that that'll cause a considerable slowdown.

Maniphest Tasks: T71981

Differential Revision: https://developer.blender.org/D9041
2020-09-29 16:10:16 +02:00
5845c06a63 Volumes: new Mesh to Volume modifier
This modifier can only be added to Volume objects. It takes a mesh
as input and generates a "density" grid near the surface or in
the enclosed volume.

Ref T73201.

Reviewers: brecht

Differential Revision: https://developer.blender.org/D9032
2020-09-29 16:03:30 +02:00
e12767a035 Volumes: support selection and outlines in viewport
Previously, one could only select a volume object in the outliner
or by clicking on the object origin. This patch allows you to click
on the actual volume.

Furthermore, the generated (invisible) mesh that is used for
selection is also used to draw an outline for the volume object now.

Reviewers: brecht

Differential Revision: https://developer.blender.org/D9022
2020-09-29 12:39:41 +02:00
6374644fd1 DNA: optimize struct reconstruction by doing some preprocessing
When loading large files that are more than a couple weeks old
(such that DNA has changed in that time), a significant amount of
time is spent in `DNA_struct_reconstruct`. This function takes a struct
in the old layout and creates a struct in the new layout from it.

This was slow because it was computing the diff between the struct
layouts every time a struct is updated. Now the steps for the struct
reconstruction is computed only once per struct. This information is
then used to actually reconstruct all structs that changed.

I measured about 10-20% speedup when loading Spring files.
E.g. `10.6s -> 8.7s` for `06_055_A.anim.blend` in BKE_blendfile_read`.

This percentage varies a lot based on the number of blocks that have
to be reconstructed and how much DNA has changed since they have
been written. In none of my tests was the new code slower than the
old code.

Reviewers: campbellbarton

Differential Revision: https://developer.blender.org/D8959
2020-09-29 12:29:01 +02:00
b41fb5542a Quiet unused variable warning 2020-09-29 12:15:00 +02:00
762d93a26b DNA: use better type for SDNA->structs
The data layout remains exactly the same..
This change just gives all the elements in `SDNA->structs` names,
making it more comfortable to work with the data.

Reviewers: campbellbarton

Differential Revision: https://developer.blender.org/D8926
2020-09-29 12:12:09 +02:00
32d4a67017 Revert "Fix T81002: Images drawn with the Python gpu module no longer draw on top in the Image Editor"
This reverts commit 085329f114.

It didn't render rendered viewport overlays correctly.
2020-09-29 09:53:55 +02:00
58b8724a48 Cleanup: spelling 2020-09-29 13:58:16 +10:00
b150071ece Cleanup: Python API Docs: Text formating 2020-09-28 20:11:06 -04:00
4d7b664e1a API Docs: Minor text improvements 2020-09-28 20:11:06 -04:00
d5353eea5b Cleanup: CMake/FFmpeg: Fix typo in message/comment
Code added in the last commit {rB2fdbe4d0501114c716fd12bc}.
2020-09-29 00:40:31 +05:30
2fdbe4d050 CMake/Find packages: add FindFFmpeg.cmake module.
The behaviour is a bit different from other find modules:
`FFMPEG_FIND_COMPONENTS` should contain the
list of required libraries before calling `find_package(FFmpeg)`.
If not set, a default set of most common libraries is searched for:
`avcodec avdevice avfilter avformat avutil`
http://ffmpeg.org/download.html

Ref D8855

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D8918
2020-09-29 00:33:13 +05:30
48a0c931ee Fix T80121: Forcefield F-curve modifier changes don't reset cache
Add a dependency graph relation Force Object Animation → Scene Rigid
Body World Rebuild. This ensures that the rigid body world is rebuilt
when a force object is re-tagged for animation updates.

The extra relation doesn't add any new calculations when the animation
is running, as the Time Source node already had a relation to the
scene's `RIGIDBODY_REBUILD` node.

The relation is created directly to the `RIGIDBODY_REBUILD` Operation. I
would have liked to target the containing Component instead. However,
that has the `RIGIDBODY_SIM` operation as entry node, which isn't enough
to actually fix T80121.

Reviewers: Sergey

Differential Revision: https://developer.blender.org/T80121
2020-09-28 17:13:40 +02:00
ddba5e0be3 Outliner: Draw hierarchy lines dashed for object children
Draw dashed lines for object child hierarchies in the outliner. This
makes the difference between collection and object hierarchies more
clear. Dashes are also consistent with viewport relationship lines.

Differential Revision: https://developer.blender.org/D8997
2020-09-28 07:54:32 -06:00
c6b904e972 Fix T80657: Not freed memory blocks with Batch-Generate Previews.
`ED_preview_icon_render()` owns the `id_copy` localized ID, so it has to
free it itself.
2020-09-28 14:56:17 +02:00
3158fc2593 Fix T80967: Alembic, crash when the imported sim from Houdini starts
Compare mesh loop count with number of loop normals before reading the
loop normals.

Houdini doesn't always write the correct loop normals to Alembic. When a
mesh is animated and then replaced by a fluid simulation, Houdini will
still write the original mesh's loop normals, but the mesh
verts/loops/polys are from the simulation. In such cases the normals
cannot be mapped to the mesh, so it's better to ignore them.
2020-09-28 14:12:42 +02:00
b88a9cf171 Cleanup: Animation, fix comments
Remove one outdated comment, and make the other into a proper sentence.

No functional changes
2020-09-28 14:12:42 +02:00
f7655dd322 UI Code Quality: Clear layout pointer on layout destruction
The layout pointer is quite ugly, but currently needed to work around
design issues. At least it should be cleared to avoid use-after-free.
2020-09-28 12:06:59 +02:00
825a32439a Cleanup: Animation, remove unused parameter from anim tagging function
Remove `bool flush` parameter from `rna_tag_animation_update()`, as every
call uses `true` anyway.

No functional changes.
2020-09-28 12:03:04 +02:00
f808f2a495 Fix T81214: Crash on Action constraint without action
A `NULL` pointer check was missing.
2020-09-28 11:23:34 +02:00
1f5331ee87 Cleanup: animation, simplify anim_flush_channel_setting_up()
Simplify `anim_flush_channel_setting_up()` by flipping conditions and
returning early. This makes it easier to understand what is actually
happening in the code.

No functional changes.
2020-09-28 11:00:15 +02:00
3fe97bced4 Cleanup: animation, split up ANIM_flush_setting_anim_channels()
Split up `ANIM_flush_setting_anim_channels()` into smaller functions. This
makes it easier to understand how it works, and makes future improvements
also easier.

No functional changes.
2020-09-28 11:00:15 +02:00
Ivan
4c19dd523e Libmv: Fix NukeCameraIntrinsics copy constructor
Copy the appropriate parameter

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D9014
2020-09-28 09:57:28 +02:00
1241802abb Fix typo in UI messages. 2020-09-28 09:09:23 +02:00
David Friedli
b1bdfb6e32 Fix T79275: Missing redraw for pinned active tool settings panels
In the 3D view sidebar, the active tool settings panel can be pinned to other
categories, and in those other categories it doesn't redraw when the active
tool changes. This commit checks for pinned panels from the "Tool" category
when checking whether to redraw.

Note that the relatively expensive string comparison is only done for
currently visible pinned panels.

Differential Revision: https://developer.blender.org/D9012
2020-09-27 23:28:28 -05:00
Pablo Dobarro
8c81b3fb8b Sculpt: Line gestures and Mask Line tool
This adds support for line gesture to SculptGestureContext and
implements a Mask Line tool, which affects everything to the right of a plane
defined by the straightline gesture.

For this to work, a new WM_gesture_straightline_oneshot_modal is needed
which only runs exec when the gesture is over.

Added as experimental as it does not have icon.

Reviewed By: Severin

Differential Revision: https://developer.blender.org/D8722
2020-09-26 22:04:45 +02:00
4c74980e7b Fix Face Set overlay rendering wrong color with modifiers
face_set_color_default was not copied when copying meshes, so when
extracting the colors in the draw cache it was using a wrong default
color ID.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D8957
2020-09-26 21:58:13 +02:00
8fb806ab15 Revert "Generate Xcode scheme files during configuration."
This reverts commit 5eb5978043.

The change was problematic:
*Advanced users may prefer managing schemes manually and adding only
a few that they need, instead of one for every library/executable
Blender builds.

*If CMake creates schema files, it overwrites the changes a developer
made every time CMake is run. If Xcode creates scheme files, it keeps
settings/ environment variables intact.

If someone runs CMake very frequently, pass
`-DCMAKE_XCODE_GENERATE_SCHEME=ON` to `cmake` while configuring.
2020-09-26 23:17:10 +05:30
8d34e81449 Cleanup: CMake config: set options in alphabetical older
No functional change.
2020-09-26 23:17:10 +05:30
fdf77341cd CMake: Remove duplicate WITH_GMP options.
I didn't realize there were more duplicates while committing
{rBf1fee433be92}.

Original was added in {rB83f8223543f58c3b0881a03b6e9ddffff91}.
Duplicate was added in the merge {rB9e09b5c418c0a436e3c84ccf}.

Ref D8822
2020-09-26 23:13:07 +05:30
74bcb32c9f macOS: Remove ASan debug flags from release config.
Setting `PLATFORM_LINKLIBS` is not required for clang, compiler and
linker flags are enough. Note that the change made in
{rBa4c5811e2127}) to `platform_apple.cmake` (appending to
`PLATFORM_CFLAGS`) has not been reverted. platform file shouldn't be
overwriting the flags.

`PLATFORM_LINKFLAGS` is overwritten by `platform_apple.cmake`, so no
point in setting it. Fixing that like `PLATFORM_CFLAGS` is out of the
scope of this change.

`PLATFORM_LINKFLAGS_DEBUG` has been replaced with generator expression
to include RelWithDebInfo and MinSizeRel build types also.
2020-09-26 23:12:57 +05:30
e7bb7836cc Fix T81205: Grease pencil material slots don't auto-erase void slots above the first material 2020-09-26 17:22:37 +02:00
0295e14f5f Fix T81168: 2.8x Crash when loading 2.79 file.
Object in the 2.7x file is on no layer at all, while this is not really
expected nor considered valid, better to cope with the case gracefully
than crash.

To be backported to 2.90 and 2.83.
2020-09-26 09:23:10 +02:00
83dc97ccc0 Cleanup: Use canonical variable name 2020-09-25 15:54:25 -05:00
9b6c5268bc Cleanup: Decrease indentation by returning early
Where the if statement was just a check for an error or an unhandled
condition and there are no else statements, the rest of the function
doesn't need to be indented.
2020-09-25 15:51:56 -05:00
4842dd022f Cleanup: Declare variables where initialized, lower scope
Also use "r_" prefix for return arguments in a few places.
2020-09-25 14:58:29 -05:00
Henrik Dick
bea4505744 Fix Tests for Weld Modifier with KD-Tree
Fixes the failing tests and reintroduces the KD-Tree solution.

Reviewed By: mano-wii

Differential Revision: https://developer.blender.org/D9013
2020-09-25 15:17:02 -03:00
1f6a1cee74 LibOverride: Cleanup: reserve debug messages to debug builds. 2020-09-25 19:11:23 +02:00
756656caff LibOverride: Better handling of cleanup of 'insert' operations in collections.
Before, it might have been possible in some cases (when there were no
items at all anymore in the collection) to miss that cleanup step,
leaving ghost useless and invalid operations around.
2020-09-25 19:11:23 +02:00
c6a9b62bb0 Fix T78343: Most properties of Ocean modifier should not be animatable.
Properties that are only used when initializing the simulation cannot be
animated (the changes in their value would not be taken into account).
2020-09-25 19:11:23 +02:00
ee51283da1 LibOverride: Tweak messages when some sub-item is not found when applying overrides. 2020-09-25 19:11:23 +02:00
d951239e1d Fix T81161: Bad properties context panel placement loading old files
These breadcrumbs used to be a panel in 2.79 and 2.80 development.
If a file was saved in those versions, and the panels rearranged in a
version that didn't have this panel, its sortorder would be changed
even though it wasn't visible or even used in that version.

A simple fix is to use a new ID name for the new version of this
panel in 2.91. "Buttons" is an old name anyway.
2020-09-25 11:51:13 -05:00
e2fe405910 Cleanup: Miscellaneous code improvements
- Declare variables where initialized
- Return early in some cases
- Use "i" as an iteration index variable
- Use bool instead of int where applicable
2020-09-25 10:54:09 -05:00
4c46a09824 Fix constrain plane not being set in tranform code
Error introduced in rB388b9162469650c
2020-09-25 12:28:22 -03:00
90ce6dbf4c UI: Improve curve geometry property tooltips
These tooltips mostly just repeated the property names, which is not
helpful at all. Changing that leaves space to be much more specific
about what the properties actually do.

Differential Revision: https://developer.blender.org/D8994
2020-09-25 09:51:13 -05:00
682e68b6ea Cleanup: silence [-Wshadow] warnings
Introduced in rBd5a6b3b18c5d.
2020-09-25 10:56:19 -03:00
6d32c7865f GPencil: Fix unreported missing context menu for pinned mode
When the mode was pinned, the context menu did not display the color wheel for the vertex color mode.
2020-09-25 15:50:36 +02:00
388b916246 Fix T80937: Changing the contrain axis does not return to the scene orientation
This was the behavior in old versions of blender.

During a transformation operation, when pressing a contrain key, the chosen
orientation is that of the scene.

If you press the same key, the orientation changes to Global or Local.

However, if you choose another contrain axis with the orientation changed,
the orientation does not return to the set for the scene.

It remains Global or Local.

Now when changing a contrain axis, no matter what the current orientation is,
it always returns to the scene orientation.
2020-09-25 10:24:05 -03:00
d5a6b3b18c Weld Modifier: Disable the KD Tree solution
This solution is causing the modifier regression test to fail.

Also fix a mistake to allocate `vert_dest_map` twice.
2020-09-25 09:37:59 -03:00
64583f3e8d Animation: set Action idroot at assignment instead of just at evaluation
Actions are either locked to a specific ID type, or "floating". Actions
in the floating state are now locked when they are assigned to an ID block.
Previously (rB94b99b5d4a7c20cf2) this was done at evaluation time, which
caused various problems:
- The ID type was set on the evaluated copy, and inconsistently flushed
  back to the original.
- A newly created Action could not be assigned to an Action constraint,
  unless a depsgraph evaluation was be forced first.

This is now resolved by calling `BKE_animdata_set_action()` to set the
action (instead of direct assignment) where possible, and calling
`BKE_animdata_action_ensure_idroot()` otherwise.

Manifest Task: https://developer.blender.org/T80986
2020-09-25 14:20:59 +02:00
5419f9a845 Cleanup: animation, reduce complexity of RNA update function
Reduce complexity of `rna_SpaceDopeSheetEditor_action_update()` by flipping
conditions and returning early.

The depsgraph tagging has slightly changed, in that the depsgraph is not
tagged at all when there is no actual animation data added. I still see
this as a non-functional change, though, as in that case nothing changed
and tagging and re-evaluating wouldn't make any actual difference.

No functional changes.
2020-09-25 14:20:59 +02:00
8ffd03aef7 Cleanup: animation, remove commented-out code
The code was commented out in rB6307c65534f6d5cf29d08220cea0dbcca9a0e118,
11 years ago.

No functional changes.
2020-09-25 14:20:59 +02:00
2ef68edad8 Cleanup: animation, deduplicate "can edit action" logic
Move "action editable" check from RNA code to Blender kernel
`BKE_animdata_action_editable()`.

No functional changes.
2020-09-25 14:20:59 +02:00
2e1339bc0b Cleanup: document and simplify BKE_animdata_set_action()
Simplify `BKE_animdata_set_action()` by flipping some conditions and using
early returns, and document which parameters can be `NULL`.

No functional changes.
2020-09-25 14:20:59 +02:00
0badb7f82d Fix T80998: DDS Image files are not displayed correctly
Blender 2.91 only. Due to recent refactoring the compressed texture
formats missed the conversion to its GL counterpart.
2020-09-25 13:11:44 +02:00
d587027015 Modifiers: add StructRNA pointer field to ModifierTypeInfo
This reduces the number of places that have to be modified
when a new modifier is added.

Reviewers: campbellbarton

Differential Revision: https://developer.blender.org/D9000
2020-09-25 12:49:18 +02:00
d15e8bdaa3 Modifiers: add icon field to ModifierTypeInfo
With this change `outliner_draw.c` does not have to be
edited anymore when a new modifier is added.

Reviewers: campbellbarton

Differential Revision: https://developer.blender.org/D8998
2020-09-25 12:45:30 +02:00
f057e92ae2 LibOverride: Fix some cleanup of unused override operations.
Handling of pointer replacements in collection items lead to validating
all operations for a given property, when some might actually be no more
valid and would need to be cleaned up.

Related to T81059, found while investigating it.
2020-09-25 11:52:18 +02:00
4a224451d1 LibOverride: Tweak messages when some sub-item is not found when applying overrides. 2020-09-25 11:52:18 +02:00
1a64f97b9e Fix T81126: Assert going to Texture Paint workspace without a UVMap
Assert happened as it could not create uv batches without an UVMap.
Solution is to only request those batches when the UVMaps are available.
2020-09-25 11:29:05 +02:00
c67873e49b LibOverride: Silence some more asserts.
Print out messages into console instead when se cannot find expected
data (this is actually normal when source library gets edited).

Note that there seems to be some issue with the 'auto-cleanup' mechanism
removing no more valid override rules on file save, will check on that
next.

Related to T81059, found while investigating it.
2020-09-25 11:07:04 +02:00
db76de147e Cleanup: SpaceGraph ED code: use boolean litterals when needed. 2020-09-25 10:24:32 +02:00
59afbf0c04 Fix T81157: Eevee MotionBlur steps setting make ao pass darker
Issue introduced by 68651534c2 due to an incorrect merge/rebase
It was resetting the AO buffer every time the time step happened.
2020-09-25 10:15:37 +02:00
56cd92413f Fix tool-system index error with mode-specific tools added to groups
It was possible to have invalid indices when a script registered
a tool into an existing group of tools.

Address issue raised by D7436
2020-09-25 17:49:13 +10:00
Yevgeny Makarov
b3e1620e21 Keymap: orbit/pan preference now applies to the track-pad as well
Ref D7279
2020-09-25 14:47:31 +10:00
Max Schlecht
aead4b3cab API Docs: Fix xref urls
Fully revert D7913 "Fix T77276: Generating Python API docs raises many warnings"

{D7913} broke xrefs/links to other types and permalinks in the docs. This makes the python api docs for 2.90 and 2.91 completely unusable.
It got partially reverted in commit e893430a63. That didn't fix those two issues though, so it should be fully reverted.

As you can see here, i'm not able to click `bpy_struct.id_data`, because no <a> tag got generated in the html.
{F8889934}

Here you can see a working, but wrong permalink, generated by clicking the little chain. (It should be `bpy.types.MeshVertices`, not `bpy.types.MeshVertices.MeshVertices`)
{F8889938}

Reviewed By: Blendify

Differential Revision: https://developer.blender.org/D8913
2020-09-24 23:14:15 -04:00
8febaae9e4 Fix T81155: Keyframe.select_control_point True when unselected
Check the selection flag since BEZT_FLAG_TEMP_TAG might be set.
2020-09-25 11:13:32 +10:00
c79b913624 Object: Move Switch Active Objects to experimental
The operator has some problems with Undo, so better put it in
experimental for now.

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D9007
2020-09-25 02:51:31 +02:00
0106e17f07 Cleanup: Move function to proper section
The main panel drawing funciton should be in the "Drawing" section.
2020-09-24 14:43:02 -05:00
80c57fe35f Cleanup: Remove unused function 2020-09-24 14:39:23 -05:00
9910b5024e Fix part of asserts in LibOverride when resynching.
We can only re-apply overrides fron the old local overrides to the newly
generated ones after all IDs have been properly remapped and renamed.

Otherwise override operations based on ID names may fail.

Related to T81059, found while investigating it.
2020-09-24 21:08:27 +02:00
934b515bc1 Fix LibOverride Resync generating orphaned data-blocks.
Part of the code handling deletion of old, not needed anymore local
override IDs, was not working properly, effectively only deleting one
ID ever.

New code should also be a bit faster, though this should not be really
visible from user perspective.

Related to T81059, found while investigating it.
2020-09-24 21:08:27 +02:00
771d041c4c Fix (unreported) memory leak in Extrude mode of the Solidify modifier. 2020-09-24 21:08:27 +02:00
Henrik Dick
744f81c936 Weld Modifier: Use KD Tree in detecting the geometry to be welded
This commit replaces the BVH Tree currently used by the Weld Modifier
with the KD Tree used by `Merge > By Distance`.

This changes the result of the Weld Modifier to more closely match
`Merge > By Distance`.

There is also a big performance advantage.

Here is an overview (models in D8995):

| 2.90 (Duplicate Limit = 0) | 2.90 (Duplicate Limit = 1) | master (BVH) (Duplicate Limit = 1) | patch (KD) |
| 1.69s| 0.17s | 0.12s | 0.029s |

Differential Revision: https://developer.blender.org/D8995
2020-09-24 15:18:34 -03:00
6877a7b3ff Fix running tests when building without portable install. 2020-09-24 18:34:55 +02:00
331f383337 Fix blender constraints automated tests when using march=native
More agressive optimization made the results differ a bit more than the
current error margin would allow. Bump the error margin to be 1e-6
instead of the previous 0.5e-7.
2020-09-24 18:33:36 +02:00
7fb0cb2b93 Cleanup: Remove unecessary storage of search filter in uiBlock
Since the search is applied all in one phase, there is no need to store
a reference to the search filter in every uiBlock. Instead just pass it
as an argument to UI_block_apply_search_filter.
2020-09-24 11:22:30 -05:00
bdbe95578d Fix crash related to liboverride differential operations code.
Root of the issue is how we generate the storage ID for the differential
override operations.

However, since those are disabled anyway currently, simply comment out
creation of this copy for now, we can revisit this if/when we decide to
re-activate differential overrides.

Related to T81059, found while investigating it.
2020-09-24 18:14:56 +02:00
244cef6f00 LibOverride: Do not assert when failing to apply an override rule.
This is actually fairly common issue if lib data changes, just print out
an info message about it for now.
2020-09-24 18:14:56 +02:00
3997630b3a Cleanup: Break early in normal validation
Before we would continue checking normal array values even if we knew
that the normal array would be conidered valid.

Break early to avoid excess iterations and make the code more clear what
it is doing.

No functional changes.
2020-09-24 18:10:47 +02:00
119d0cd2ab Fix normal computation in opensubdiv when surface derivates are the same
In very rare occations, the returned derivates would be the same. This
would lead to the normal calculation breaking (zero normals).

Solution: Add this edge case to the other corner case checks.

Reviewed By: Sergey
2020-09-24 18:08:45 +02:00
0d7036b40e Fix T80424: 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.

Alternatively we can check for `context->for_render` in
`input_preprocess()`, but I think fix above is more correct.

Reviewed By: sergey, brecht

Maniphest Tasks: T80424

Differential Revision: https://developer.blender.org/D8838
2020-09-24 16:20:13 +02:00
6e138e90d0 Fix T80874: Actions inside NLA Strips are not copied to buffer/append
Restore NLA Action expansion code that was accidentally removed in
rBbed634c4f96.
2020-09-24 16:17:30 +02:00
538d9bb41d Fixup for license changes
There was still a cmake file that was explicitly referring to the GPL3 license.

This was failing only on Windows.
2020-09-24 15:51:47 +02:00
58dc059ad3 Fix T81096, T81127: Errors with the typed value for x-axis constrain
`applyNumInput` does not write all axis values and does not consider
the orientation.
2020-09-24 10:36:01 -03:00
f3ac39b857 Fix T80708: FCurve modifiers change behavior after editing NLA clip
Tag an Action for recalculating animation when it's pushed down onto the
NLA stack, as its effective boundaries change. Normally an Action spans
all of the timeline, and the effects of Cycle modifiers are visible
everywhere. When the Action is converted to an NLA clip, the modifier's
effect should only be visible for the duration of the NLA clip.
2020-09-24 15:17:30 +02:00
0dfafa8124 NLA: remove tagging copy-on-write when tagging recalc-animation
Remove `ID_RECALC_COPY_ON_WRITE` when tagging `ID_RECALC_ANIMATION`; the
former is unnecessary when using the latter.

No functional changes.
2020-09-24 15:17:30 +02:00
424084eeb5 Cleanup: NLA, refactor condition, use early return
Simplify code by replacing `if (strip) { everything; }` with
`if (strip == NULL) { return; }`.

No functional changes.
2020-09-24 15:17:30 +02:00
7ba30d35d1 Fix T80727: Drivers: deleting all keyframes leaves an uneditable f-curve.
A NULL bezier pointer does not mean that the fcurve is not editable, it
only is if it actually has some baked sample points too.
2020-09-24 14:05:42 +02:00
748efc710c Fix (unreported) Smart UV Project not adding UVMap
Since porting this to C in rB850234c1b10a, Smart UV Project would not
add a UVMap (if none existed already) anymore.

Not having a UVMap already is a reasonable situation though when e.g.
starting off fresh by deleting an existing UVMap or also when applying
certain generative modifiers. This is also inconsistent with all other
unwrap operators (all of them will create a UVMap if none exists
already)

Differential Revision: https://developer.blender.org/D9001
2020-09-24 13:06:37 +02:00
5b612e788c ISC and Boost licenses 2020-09-24 12:49:36 +02:00
0434efa09d Move license files to license subfolder
For the final builds instead of leaving all the license files in the main
folder, we move them to a "license" folder.

Also, adding more licenses here (MIT, Apache, ...).

Differential Revision: https://developer.blender.org/D8999
2020-09-24 12:49:36 +02:00
f564126cdf Fix: add radius attribute in simulation modifier
This is necessary to not make it crash immediatly after recent changes.
2020-09-24 11:56:02 +02:00
f1fee433be GMP/CMake: Remove duplicate GMP search logic.
Original was added in rB83f8223543f58c3b0881a03b6e9ddffff91.
Duplicate was added in the merge rB9e09b5c418c0a436e3c84ccf.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D8822
2020-09-24 15:20:07 +05:30
4786719dbd Cleanup: spelling 2020-09-24 14:27:48 +10:00
15afaa3db2 Property Search: Fix matches in headers not used for expansion
Setting the search match flag every time property search runs can
invalidate the results for panel headers. Instead, clear the flag on
every redraw and or the result of every search in the panel to it.
2020-09-23 16:24:20 -05:00
23e4bbefae Fluid: Fix clang-tidy error
Issue was introduced in rB8d1123ba220b.
2020-09-23 19:49:39 +02:00
ffde556e9e Fix incorrect comparison for panel sorting
"Reported" by Valentin (Poulpator).
2020-09-23 12:06:42 -05:00
bf0cefe738 UI: Clarify curve geometry factor and mapping tooltips
The "bevel_factor" for curves also applies when there is no bevel and
only extrusion. rB4e667ecef92f addressed this by moving the factor
and mapping properties to their own subpanel, but the property
descriptions still don't reflect that. This commit replaces "Bevel" with
"Geometry" for this situation. The property identifiers are not changed.
2020-09-23 11:17:14 -05:00
51c7a854fe Fix T81057: PoseBone Constraints are displayed in Object Constraints tab
Own mistake in rB9dcae4eb17d7b.

We cannot use ED_object_constraint_active_list in uiTemplateConstraints
since it is dependent on mode (pose vs. object). Now get object
constraints directly when use_bone_constraints is false.

Note: unfortunately a derivate of this bug has made its way into 2.90.1

Maniphest Tasks: T81057

Differential Revision: https://developer.blender.org/D8989
2020-09-23 16:08:14 +02:00
bda274d1fe Fix T80833: Fluid Initial Velocity 'Source' incorrect when enabling Inflow
Do not escape flow / effector objects if they have a disabled use flow / use effector flag.

Vertex velocities still need to be kept track of in order to have correct object velocities when enabling flows / effectors intermittenly. It is possible though to skip the emission loop if the flags are disabled.
2020-09-23 15:54:33 +02:00
738615cdfd Missed in last commit
It is necessary to confirm the constrian.
2020-09-23 10:54:23 -03:00
ba014586a0 Fix T81069: Can't lock axis with move anymore, using Shift+MMB
This fixes and reverts commit c7287ffaec

Due to hardcodded keys, the modifier for auto contrain plane did not
work with custom keymaps and was in conflict with other keyitems.

Its usability is also confusing since it cannot be used without
`MOD_PRECISION`

But instead of removing it, it is better to make this modifier compatible
with custom keymaps and keep the conflict.
2020-09-23 10:45:56 -03:00
4e8d3123f0 Cleanup: remove dead code in point cache and openvdb wrapper
Reviewers: brecht

Differential Revision: https://developer.blender.org/D8988
2020-09-23 14:57:41 +02:00
f09fcda8b6 Fix T81081: GPencil preset error
Caused by still having 'texture_opacity' in the preests and the preset
operator (but this was removed in the 2.83 rewrite).

Maniphest Tasks: T81081

Differential Revision: https://developer.blender.org/D8990
2020-09-23 13:28:14 +02:00
9ad80d9896 Cleanup: remove last uses of WITH_SMOKE 2020-09-23 11:39:31 +02:00
e5c0d4613a Cleanup: remove smoke code from pointcache
This code is not used by the new fluid simulation system.
Therefore, it does not make sense to keep it around.
We do want to integrate the fluid system with the generic cache
system eventually, but refactoring the system is easier when there
is less dead code that has to be refactored.

Note, I could not remove BKE_ptcache_id_from_smoke entirely yet,
because the depsgraph seems to expect that object that
uses DEG_add_collision_relations also has a pointcache.
That is because it wants to reset the point cache when any of the
other objects changed (this does not work with fluids currently).

Reviewers: sebbas

Differential Revision: https://developer.blender.org/D8987
2020-09-23 11:39:31 +02:00
Nathan Letwory
782baa8f54 Windows Release: Script creation of MSIX package
Script create_msix_package.py will download the ZIP file
from the given URL. It will create the MSIX package
with the version number and publisher ID given.

Strongly recommended are the path to a valid PFX file, and the
password to use that PFX file. These are needed for signing
the resulting MSIX package. The signing step is optional though,
but the resulting MSIX package cannot be installed outside of the
Microsoft Store

Example

set VERSION=2.83.2.0
set URL=https://download.blender.org/release/Blender2.83/blender-2.83.2-windows64.zip
set PUBID=CN=PUBIDHERE
set PFX=X:\path\to\cert.pfx
set PFXPW=pwhere

python create_msix_package.py --version %VERSION% --url %URL% --publisher %PUBID% --pfx %PFX% --password %PFXPW%

Requirements:
* Python default from the Microsoft Store should do (3.8)
* requests can be installed with `pip install requests`

Note that for an LTS release that gets uploaded to its own LTS application release
in the store you need to specify the `--lts` switch on the command-line to the script.

Upon completion there will be a file with the
name blender-2.83.2.0-windows64.msix. In case PFX file and its password were
given on the command line MSIX package will also be signed for the Microsoft Store.

Related Wiki page: https://wiki.blender.org/wiki/Process/Release_On_Windows_Store

Reviewed By: jbakker

Maniphest Tasks: T77348, T79356

Differential Revision: https://developer.blender.org/D8310
2020-09-23 11:23:10 +02:00
c3a0618fbf LibOverride: Add operator to convert a proxy object into an override.
In the end the process is surpringly simple, we only need to manually
convert the proxy itself into an override (which is trivial), and then
run common code with the default 'make override' operation.

Fix T81059: Add operator to convert proxies to library overrides.
2020-09-23 11:07:03 +02:00
6fde0050c4 Fix (unreported) LibOverride: RNA asserts when applying overrides.
Some RNA setters require ID data they operate on to be in G_MAIN.
Unfortunately, when we apply overrides as part of a .blend file reading,
new Main is not yet made global one, so we have to do it temporarily
here.

This is a fairly ugly hack, but it should be harmless and safe.
2020-09-23 11:07:03 +02:00
b93b75b5fb LibOverride: Tweak override creation code.
This is a first step towards supporting conversion of proxies, done
separately to make it easy to pinpoint in case it would create problems.

It is not expected to cause any change in behavior currently.
2020-09-23 11:07:03 +02:00
a6b16cfd80 Cleanup: remove 'r_' prefix for variables
This is for return arguments, also remove redundant NULL check.
2020-09-23 18:22:46 +10:00
286909ded7 Keymap: use release event instead of click
Minor change to last commit, prefer release as click depends on
not moving the mouse cursor.
2020-09-23 16:59:13 +10:00
447dde3c72 Keymap: use D-key click to avoid conflict with grease pencil drawing 2020-09-23 16:55:40 +10:00
8963671bcc Fix T73858: Gizmo.use_draw_scale doesn't work as expected 2020-09-23 15:51:23 +10:00
02a204fe67 Fix T68024: Crash from missing original-index mesh layer
Constructive modifiers were not initializing an original index layer
in the case a previous deform modifier created 'mesh_final'.

This happened in the case of multiple deform modifiers that deform along
normals, as requesting normals caused the final mesh to be created.

Ensure mapping data is created in the case
only non-constructive modifiers have run.
2020-09-23 15:26:29 +10:00
ea5c8c4e84 Cleanup: re-order constructive modifier checks
Minor changes to simplify fix (coming next), no functional changes.
2020-09-23 15:26:01 +10:00
5a28090977 Fix outliner collection icon in light theme
Ensure the theme colors are used for the collection icon when there are
no color tags present, otherwise it draws completely black.
2020-09-22 21:06:48 -06:00
358a8e00bd Cleanup: Quiet unused variables warning 2020-09-22 13:36:06 -05:00
88970e3900 GPencil: Improve default brush draw mode
Mainly a UI adjustment, no functional changes

To have the default mode in the advanced panel as separated option is not the best solution.

Now, there is a pin option and when it is enabled, the brush keeps this mode.

Differential Revision: https://developer.blender.org/D8974
2020-09-22 20:11:28 +02:00
dab50ad718 Cleanup: use float3 instead of float4 for shadow, since w is never used
Contributed by pembem22.

Differential Revision: https://developer.blender.org/D8947
2020-09-22 16:36:43 +02:00
b63e6ab8d2 Fix Cycles SSS incorrect rendering of zero radius in green channel
Thanks to pembem22 for finding the problem.

Ref D8949
2020-09-22 16:28:12 +02:00
Alex Strand
3873a0f490 Fix COLLADA failing to export HDR emission strength
HDR is not supported by COLLADA, so clamp to export the closest approximation.

Differential Revision: https://developer.blender.org/D8955
2020-09-22 16:07:37 +02:00
b21e2cfd03 CMake: Enable WITH_POTRACE by default
All platforms have landed the libs, this can be on
by default now.
2020-09-22 08:03:50 -06:00
e77f986fa0 MeshAnalysis: Optimize the detection of intersecting geometry
For the self overlap result, each intersection pair does not need to
be tested twice.
2020-09-22 11:00:24 -03:00
d1f906e874 Fix T80444: Triangle-Triangle intersection regression in 2.90
The problem is due to lack of precision with small and coplanar triangles.

Also, triangles that have vertices with the same coordinate are at the
threshold of the intersection.

We could add an epsilon to consider the minimum distance for intersection.

But that would add a lot of overhead to the code.

The solution used is to increase precision using doubles.
2020-09-22 11:00:24 -03:00
cbae82ba96 Fix T78823: Slash in custom property name does not work
Some characters: `'`, `"`, and `\`, can cause problems with RNA paths.
Instead of using more complicated handling to deal with those cases,
we can just prevent these characters from being used in custom property
names.

This commit checks for these characters to `idp_try_read_name`, where
other checks like length are already done.

Differential Revision: https://developer.blender.org/D8839
2020-09-22 08:48:39 -05:00
626201683e Cycles: add update flags to Node and SocketType
Those flags are meant for detecting which socket has changed, so in the
future we can have more granular updates.

`Node` now stores an `update_flags` member which is modified every time
a socket is changed though `Node::set`. The flags are or-able bits
stored in `SocketType` instances. Each `SocketType` stores a unique bit
out of 64, for the 64 bits of an uint64_t; the bit
corresponds to the index of the socket in the `Node`'s sockets array +
1, so the socket at index 5 will have the 6th bit set as its flag. This
limits us to 64 sockets per Node, which should be plenty for the current
set of `Nodes` that we have.

This does not change the behavior of other parts of Cycles.

This is part of T79131.

Reviewed By: brecht

Maniphest Tasks: T79131

Differential Revision: https://developer.blender.org/D8644
2020-09-22 14:50:43 +02:00
8d1123ba22 Refactor for effector / collider velocities
This refactor is in response to an unreported bug in which overlapping, moving colliders produced an unstable simulation.

Things that change apart from cleanup through this refactor:
- Effector objects with no velocities (either non-animated or animated but non-moving object) will explicitly set zero velocities in their flow bounding box.
- When applying object velocities to the global grid, they will now be accumulated per cell (add and not set velocities). Later they will be averaged with the object count at any cell.
2020-09-22 14:02:53 +02:00
edd19c1df9 Fluid: Fix for script export (standalone mode)
The OpenVDB update added a load() function. This function clashes with a helper IO function (only used when exporting and running the simulation externally) that was also named load().
2020-09-22 14:02:53 +02:00
97ec16d68f Fluid: Refactor for initial velocities
Removed invel MAC grid since it is sufficient to use the cell centered vec3 representation. When setting initial velocities these will be interpolated by the setter functions.
2020-09-22 14:02:53 +02:00
Jeroen Bakker
b17cca6966 Fix T81026: Image Editor: Alpha (like Bloom) not showing properly
With the new image editor drawing there were was some mutual exclusive
functionality. When rendering the alpha was shown correctly or the pure
emissive colors were shown correctly, but never both. The cause of this
is that the image_gpu did not used the correct alpha mode when generating
gpu textures for non-images (render results, compositors viewer)

The implementation always checked the alpha_mode. Alpha mode is an
attribute for images, but aren't set for non images. This patch adds
a more detailed check to ensure that the gpu texture is premultiplied.

The issue has been tested using several bug report files and production
files.

Reviewed By: Brecht van Lommel

Differential Revision: https://developer.blender.org/D8978
2020-09-22 13:52:54 +02:00
085329f114 Fix T81002: Images drawn with the Python gpu module no longer draw on top in the Image Editor
Since {D8234} the image editor is drawn using a depth buffer.
When using `draw_texture_2d` the image is drawn using the 2D_IMAGE
shader. inside the vertex buffer the image was pushed to the background.
This was introduced by {648924333234} what seems to be out dated as we
have done several overhauls in this area. (workbench refactor, overlay
engine refactor, color management pipeline).

This patch removes the pushing of the image to the background.
2020-09-22 11:17:17 +02:00
222ed9f781 Fix T80943: return early when field to visualize is NULL 2020-09-22 10:43:11 +02:00
ee89106ac1 Fix T80915: Image editor only displays the first frame during 'Viewport render animation'
During viewport render animation the gpu textures weren't tagged as
invalid. As the image uv editor now draws the gpu texture only the first
was shown as it wasn't refreshed with the actual image data.
2020-09-22 10:38:22 +02:00
129d9f79c9 Cleanup in style from previous commit.
Forgot that arc land also did the pus ot originh.
2020-09-22 10:33:22 +02:00
Martijn Versteegh
c5efd0939f Fix T80859: Thread safe pixeldata concersion from float to uchar and v.v.
I created a bugreport T80859 earlier.

The problem is in the file source/blender/editors/sculpt_paint/paint_image_proj.c (line numbers against commit d376aea61)

at the lines 5309 and 5320 the functions `IMB_rect_from_float(...)` and `IMB_float_from_rect(...)` are called from threaded code on a shared ibuf.
However, ps->reproject_ibuf is shared between threads, so this is not thread-safe.
This is a race condition and leads to wrong output when projecting float data onto a uchar texture or vice versa on a multithreaded system.
The checks on line 5308 and 5319 are already a race condition.

I created this patch which fixes the problem , but I'm not sure if I'm overlooking something.
This makes sure reproject_ibuf contains the correct formats *before* the threadpool is started.

I replaced the original location of the conversions with BLI_asserts(). That may be overkill?

Reviewed By: #sculpt_paint_texture, mont29

Maniphest Tasks: T80859

Differential Revision: https://developer.blender.org/D8936
2020-09-22 10:30:05 +02:00
af7378bf2a Fix T81013: Weight Paint Overlay XRay fails with clipping
When introduced in rB1ca1744c29e2, the Weight Paint Overlay XRay's
corresponding depth pass was not considering clipping planes.

Maniphest Tasks: T81013

Differential Revision: https://developer.blender.org/D8970
2020-09-22 10:22:49 +02:00
b67c90a822 Cleanup: reduce variable scopes 2020-09-22 10:08:02 +02:00
d037ac315b Fix T80996: Weight Proximity modifier: crash going to editmode on a
target in certain situations

Regression from rBdeaff945d0b96.

mesh_ensure_looptri_data would overflow.

Crash would only happen if a Data Transfer modifier (transferring
UVs) follows, so exact reason for this is not yet entirely clear. Also
there are edit-mode versions of the following BVH lookup functions so it
could be avoided (since this is a expensive operation), marking as TODO.

Similar fix as
- rB0945a79ed1eafae444d3021a5912cb39801a7209
- rB56d7e39b92997768b3db8ce2dbc262f869994145

Reviewers: mont29, campbellbarton

Maniphest Tasks: T80996

Differential Revision: https://developer.blender.org/D8973
2020-09-22 09:48:13 +02:00
3cbc5dd90e Object: check for negative index access with duplicator reading UV's 2020-09-22 15:54:17 +10:00
a9dceed2a7 Cleanup: comments, spelling 2020-09-22 15:16:36 +10:00
b2782f78ba Fix warning building without potrace
The library is no longer in extern, so it isn't necessary to include it
here.
2020-09-21 21:46:15 -05:00
4e667ecef9 UI: Add curve geometry start and end panel
The placement of the start and end factor and mapping settings for
curves has been quite misleading for a long time. They were in the
"Bevel" subpanel, but they aren't related to bevel because they affect
curves with only extrusion and no bevel.

This commit moves these properties to their own subpanel, labeled
"Start & End Mapping".

Differential Revision: https://developer.blender.org/D8910
2020-09-21 19:19:21 -05:00
Henrik Dick
8eda3ddc4f Weld Modifier: Performance improvement
This commit contains the Performance improvement, that was originally
proposed in D8966.

It improves the performance of the Weld Modifier by a lot.

It had a loop with execution time O(N^2) which is now O(N*log(N)) at a
bare maximum.
2020-09-21 16:29:33 -03:00
6a9e9bef44 Cleanup: Reduce indentation by returning early
Checking for NULL icons or draw info can remove some indentation later
in the funcitons, making the code more readable.
2020-09-21 13:21:22 -05:00
4d62bb8fe5 GPencil: New Trace images using Potrace
This patch adds a new operator to convert a black and white image into
grease pencil strokes.

If the image is not B/W, an internal conversion is done.

This is the first operator using Potrace, but we expect to add more features in next Blender versions.

Reviewed By: HooglyBoogly

Maniphest Tasks: T79877

Differential Revision: https://developer.blender.org/D8951
2020-09-21 20:03:25 +02:00
d93db4f30c Cleanup: Declare variables where initialized 2020-09-21 12:14:31 -05:00
e5a572157d Fix T80899: Crash on editing multiple UVs of multiple different objects at the same time
The issue was two fold.

First something sets the loop element tag and doesn't clear it before
the UV code in question tries to use the tags. Added a sanity clear to
make sure that it operates on a clean tag state.

The next one was that the UV maps in question had quite a few points
that had zero length UV loop edges. This would lead to division by
zero.

Reviewed By: Jeroen Bakker, Brecht

Differential Revision: http://developer.blender.org/D8967
2020-09-21 16:09:51 +02:00
9d3550d781 Various fixes in UI messages.
Along some other typos in comments or variable names.
2020-09-21 15:18:13 +02:00
a34e7c3e5d Cleanup (UI): Early-exit rather than having a big-ish conditional body
It's generally considered a better codestyle to check conditions early
and exit early when they are not met, over having most logic of a
function within a big `if`-block. Otherwise people have to go over the
entire block to see if there's possibly an `else` somewhere, or any
followup logic.
2020-09-21 15:03:02 +02:00
7883ccd29f Fix T80854: Search buttons fail in Adjust Last Operation Panel
There's the old and ugly hack where the `uiBut.poin` points to the
button itself. When reallocating the button we have to update that
pointer of course.
2020-09-21 15:01:40 +02:00
87d2ac9681 Cleanup: move some paint helpers to ED_ 'namespace'.
Those two functions had `BKE_` prefix, were defined in BKE headers, but
implemented in ED code, yuck.

Moved everything to ED area for now, since those do not look fondamental
enough to belong to BKE, and none of their usages requires it currently.
2020-09-21 14:43:29 +02:00
82aa300e1c Fix T79373: Forbid painting on linked image from 3DView.
As noted by @lichtwerk (thanks), one can have a local object and/or
material using a linked image data-block, this case needs some different
handling to prevent painting on such linked image.

For now, tweak `BKE_paint_proj_mesh_data_check` (eeeek, that name
prefix!) to consider paintslots with linked image as 'non-existing'.
2020-09-21 14:24:55 +02:00
154752243d Add missing new liboverride option to py-defined collections props doc. 2020-09-21 13:54:58 +02:00
88a9d82bbb Cleanup: Remove weird assert in button handling
The function this was in already checks the conditions under which it
can operate (as it should). No need to force the caller to do these
(quite specific) checks, the function can just do nothing if the button
doesn't need these operations.
Otherwise we'd have to always execute these checks before calling, which
makes calling it a hassle, makes the code harder to follow and generally
harder to maintain (what if the conditions change?).
2020-09-21 13:15:43 +02:00
92454ae100 Fix assert failure when using Ctrl+Mousewheel on Object Mode button
Do a proper check to see if the button supports Ctrl+Mousewheel cycling.

See T80659.
2020-09-21 13:15:43 +02:00
b3c6ab5084 Fix datatoc_icon linker errors with ASan enabled.
Error introduced in {rBf9fcb25d521d}.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D8964
2020-09-21 16:38:31 +05:30
6836a40287 Make deps: Enable fPIC for Linux
Similar to D8823.
2020-09-21 12:53:24 +02:00
216a221876 Implement ID properties support for TimeMarker
Allows scripters to store additional information in the marker itself instead
of using work-around approach based on marker names and such.

Differential Revision: https://developer.blender.org/D8944
2020-09-21 12:25:45 +02:00
3791dbea1e Fix T79965: mesh.transform() modifies referenced layers
Originally was noticed when transforming mesh created by
object.to_mesh() from an object without modifier, in which case the
result references CustomData layers used by the object itself.

The issue goes a bit deeper: mesh.transform() should never modify
referenced layers, hence it should duplicate referenced layers.

This fix changes one specific aspect of the reported behavior. The
case where vertices coordinates are modified manually will still have
affect on the source mesh (as no referenced CustomData layers are being
duplicated). Proper fix for this case is not yet clear to me.

Differential Revision: https://developer.blender.org/D8939
2020-09-21 12:23:30 +02:00
abc90d6b03 Fix T80931: Proporional Editing Cursor Draws Incorrect
The incorrect view was setup so it was drawn in pixel space. This patch
changes it to use UV space.
2020-09-21 11:39:32 +02:00
d72b5785eb Fix T79373: Forbid painting on linked image.
There is just no reason to support that kind of useless behavior.

Some remote TODO could be to define a process based on liboverride and
layers.
2020-09-21 10:49:39 +02:00
b8b60e132d Fix T59272: dead particles not included in render, but visible in viewport
The issue was that the pointcache was not storing dead particles,
even though they are displayed. This lead to the rendering issue,
because only alive particles can be read from the point cache in
the frame that is rendered.

This also fixes an issue unrelated to rendering: when dead particles
are displayed, their position is incorrect when some frames are
skipped during playback.

Reviewers: brecht

Differential Revision: https://developer.blender.org/D8907
2020-09-21 10:46:35 +02:00
3bb53b0ee6 Cleanup: Sculpt/Paint ED code: correct return constant types.
Mainly use false/true for bool, but also a few others.

No change in behavior expected.
2020-09-21 10:37:23 +02:00
213445e389 Fix T66614: Text objects: Truncate overflow for non-top aligned text 2020-09-21 18:00:36 +10:00
701c3e499f Cleanup: correct naming IMAGE_Z_DEPTH
IMAGE_DEPTH is used for bit depth.
2020-09-21 07:53:40 +02:00
f5b6b82598 Fix T80520: Tris to Quads ignores UV delimit option 2020-09-21 15:05:33 +10:00
b51d836fcc Cleanup: balance braces, spelling
Keep braces balanced where possible, even with ifdef's as it avoids
confusions with editors calculating correct indentation level &
finding matching brackets.
2020-09-21 15:04:09 +10:00
e14894aad2 Fix T80993: Crash duplicating inactive workspace
We need to check for the property editor's runtime struct
before duplicating it.
2020-09-20 13:23:49 -05:00
0d5aa352d3 Fix broken Windows buiilds after own recent commit in read/write code.
Usual issue of win32 not following POSIX standards.
2020-09-20 19:34:12 +02:00
cdad684ada Fix (unreported) wrong definition of ssize_t for windows.
Since at least MSVC2010 there is a `SSIZE_T` available for windows, use
it to typedef `ssize_t` on this platform.
2020-09-20 19:32:46 +02:00
5ea1049e75 Sanitize type 'size' parameters in our read/write file code
This patch tries to sanitize the types of our size parameters across our read
and write code, which is currently fairly inconsistent (using `int`, `uint`,
`size_t`...), by using `size_t` everywhere. Since in Blender file themselves
we can only store chunk of size `MAX_INT`, added some asserts to ensure that
as well.

See {T79561} for details.

Differential Revision: https://developer.blender.org/D8672
2020-09-20 18:41:50 +02:00
86c5d1f4aa LibOverride: add checks to RNA collections editing utils.
Collections of liboverride data only support insertion of new items (and
deleting or moving those around). No operation on existing items from linked
data is allowed.

Reflect that in RNA functions used to edit py-defined RNA collections.

Note that this is not ideal currently, it does the job but feedback to
user is rather poor. Ideally add-ons should implement higher-level
checks for override cases in their operators.
2020-09-20 17:00:07 +02:00
1c98bb83a4 Cleanup: Correct comment in newly added liboverride code for IDProp collections. 2020-09-20 16:26:39 +02:00
9756c66720 LibOverride: expose PROPOVERRIDE_LIBRARY_INSERTION to py-defined properties.
This will allow add-ons to define Collection properties that support
item insertion in library override context.
2020-09-20 16:26:39 +02:00
db314ee7a4 LibOverride: support inserting items in py-defined (IDProp-based) collections.
Supporting IDProperty-based data storage here in a generic way is fairly
simple, unlike actual RNA data (DNA-based), for which getting a proper
generic way to duplicate them from within RNA is currently not really
possible.

Part of T79562.
2020-09-20 16:26:39 +02:00
5e509a3aa9 RNA access: Add utils to search a collection item from its name, and get both item pointer and its index in the collection. 2020-09-20 16:26:39 +02:00
8afa42b05a IDProperties: Add utils to duplicate content of one IDProp into another. 2020-09-20 16:26:39 +02:00
0bd736e5da GPencil: Small tweak to Fill panel for Holdout
For gradient, put the parameter below both colors.
2020-09-20 15:29:02 +02:00
31ae1462f2 GPencil: Move Holdout parameter below Base Color
It's better keep this parameter here instead to put it at the end of the panel.
2020-09-20 15:29:02 +02:00
e351c96089 Fix a wrong return type (float instead of double) in double2.hh 2020-09-20 08:38:44 -04:00
f470a02afa Fix T80982: Crash using custom orientations beside the first
Regression in f7829787da
2020-09-20 15:59:22 +10:00
84653f015a UI: Gray out fade inactive geometry overlay slider when off
The slider should be inactive when the setting is turned off like
the wireframe slider.
2020-09-19 23:11:58 -05:00
56748dbbcd Fix T61985: NLA Bake exception baking pose with non-pose selection 2020-09-20 14:00:14 +10:00
7d2a67f258 Cleanup: Fix clang tidy inconsistent parameter warning 2020-09-19 22:38:36 -05:00
1d5b191f9f UI: Always set curve fill mode inactive for object bevel type
The bevel type is a more useful check for graying out this property
because its effects will be apparent before choosing an object. Before,
the fill type property would only gray out with a bevel object selected.
2020-09-19 22:13:23 -05:00
Cody Winchester
e0f13f41c6 Fix invert vertex group weight miscalculation for modifiers
Warp & weight vertex-group editing modifiers miscalculated vertex weight
inversion, the weights were multiplied before being subtracted from 1.

Ref D8241
2020-09-20 12:54:38 +10:00
94a63f7505 Fix T80945: Build modifier not updating after outliner copy
Build modifiers linked or copied to objects from the outliner would not
animate until the file was saved and reopened due to a missing depsgraph
relations tag.
2020-09-19 16:33:45 -06:00
4115229637 Cleanup: Use shorthand variables
We don't use the other variables in the sorting struct,
so we might as well use the panels directly.
2020-09-19 16:24:10 -05:00
c9c51c07cf Fix light rotation slider in Lookdev popover being disabled
Light rotation is supported both in world and view light orientation in
lookdev, so no reason to disable it.

Reviewed By: Blendify

Differential Revision: https://developer.blender.org/D8958
2020-09-19 18:07:49 +02:00
d989ae84a8 GPencil: Change tooltip for Holdout option 2020-09-19 10:56:36 +02:00
14b2a35c8b Cleanup: use parenthesis for if statements in macros 2020-09-19 16:28:17 +10:00
17a2820da8 Cleanup: consistent TODO/FIXME formatting for names
Following the most widely used convention for including todo's in
the code, that is: `TODO(name):`, `FIXME(name)` ... etc.
2020-09-19 14:34:32 +10:00
a78130c610 Cleanup: spelling 2020-09-19 14:26:40 +10:00
8ca698427f Fix T80880: Outliner colored hierarchy lines on objects
Expanded objects with children immediately after a colored collection
would have the color applied to their hierarchy lines as well. The fix
is to reset the collection color to `COLLECTION_COLOR_NONE` for each
open subtree.
2020-09-18 19:32:44 -06:00
7b9e47a35e EEVEE: Fix Missing GGX multi-scattering on Glass BSDF
Oversight that should have been in rB6f3c279d9e70
2020-09-19 00:24:43 +02:00
6f3c279d9e EEVEE: Add support for GGX Multi-scatter
Based on http://jcgt.org/published/0008/01/03/

This is a simple trick that does *not* have a huge performance impact but
does work pretty well. It just modifies the Fresnel term to account for
the multibounce energy loss (coloration).

However this makes the shader variations count double. To avoid this we
use a uniform and pass the multiscatter use flag inside the sign of f90.
This is a bit hacky but avoids many code duplication.

This uses the simplification proposed by McAuley in
A Journey Through Implementing Multiscattering BRDFs and Area Lights

This does not handle area light differently than the IBL case but that's
already an issue in current implementation.

This is related to T68460.

Reviewed By: brecht
Differential Revision: https://developer.blender.org/D8912
2020-09-19 00:09:51 +02:00
aa2e978bd8 Fix T79557 EEVEE: Normalize in vector math node is not null vector safe
This add basic null safe handling for this operation.
2020-09-18 23:42:51 +02:00
a0a536bbff Property Search: Don't set expansion for panels in inactive tabs
The search should check if a panel is active before changing its
expansion, otherwise it sets the expansion for all of the region's
panels, even invisible ones in other tabs.
2020-09-18 16:39:43 -05:00
ea72c5d69b GPUShader: Fix wide line emulation with flat color interpolation.
This was causing flashing colors in the node editor grid.

This is because in some cases the flat color is only set on the provoking
vertex which is the last of the primitive by default.
2020-09-18 22:41:49 +02:00
649b0ccac8 GPUImmediate: Add system wide workaround for wide line
This makes wide line supported on MacOS and other implementation that
does not support wide line by default.

This workaround works for all Line types but only if using one of the 5
default shaders.

The workaround is completely isolated and invisible to the outside. It has
no side effect.

Note: This does not affect the GPUBatch drawing.
2020-09-18 22:41:49 +02:00
f17302be6b UI: Remove colons in property names 2020-09-18 15:40:09 -05:00
104df2453a deps: fix build issue on windows.
Windows does not build libxml2 so the dependency recently
added for mac caused a cmake error.
2020-09-18 13:52:06 -06:00
05c57dc563 UI: Use property split in UV editor panels
This is not an exhaustive change, just for the 2D cursor and
UDIM grid properties. Also vertically align the "UV Vertex"
buttons like in the 3D view panels.
2020-09-18 14:37:33 -05:00
a13b14b67d Fix misalignment of menu items in Preferences > Save & Load menu
Checking for the layout alignment is not a reliable way to filter out
which items need the additional icon/text offset. Instead check if the
buttons are icon-only (which we rarely do, e.g. for collection colors in
the Outliner context menu).
2020-09-18 20:59:27 +02:00
9ce1a04e2a Cleanup: Resolve warnings
Unused variables, missing include for declaration, missing 'static'
specifier. Also rename function to match naming convention.
2020-09-18 20:51:22 +02:00
9d528381b5 UI: Support interacting with superimposed icons while editing
For example you can now start entering text in the Properties or
Outliner search, and press the 'x' while the button is still in
text-edit mode.
This way you don't have to exit text editing first, before being able to
quickly clear the string with a mouse click. So this is a small
improvement for convenience.

It also works for the eyedropper (change to picking an object while text
editing) or the '+' and '-' icons in the file saving dialog.
2020-09-18 20:38:45 +02:00
aacf8d75f5 UI: Support mouse over highlighting for superimposed icons
E.g. the 'x' icons or eyedropper icons in text buttons. They didn't use
to have any mouse over feedback, now we dim the icon until hovered.
This kind of feedback helps users see that the icons are interactive,
and if they are within their interaction hotspot.
2020-09-18 20:38:45 +02:00
a6a0cbcd74 Curves: Allow caps for all geometry types
I think this wasn't allowed before because the section of a curve was
built in multiple parts. But since rBe34d3e32dda7, the whole slice
of a curve is built in one piece, so we can easily support curve
caps for all geometry types, including the new custom profile option.

Note that this also allows "caps" when the fill type is not full.
They could easily be disabled by checking for "Full" fill type
if that was preferred in the future.

See the patch for images.

Differential Revision: https://developer.blender.org/D8911
2020-09-18 13:30:01 -05:00
5502517c3c Unify all XYZ symmetry options using Mesh Symmetry
This adds XYZ symmetry as a property of meshes and updates all modes to
use the mesh symmetry by default to have a consistent tool behavior
between all modes and when switching objects.

Reviewed By: brecht, mano-wii, campbellbarton

Maniphest Tasks: T79785

Differential Revision: https://developer.blender.org/D8587
2020-09-18 19:58:58 +02:00
Pablo Dobarro
827dfd76dd Object: Switch Object operator
This object operator exits and frees the edit data of the
current object and enters the same mode in another one in a single step,
without going through object mode or keeping multiple edit object data
active. It is assigned to the D key.

This solves all conflicts that the right/click select keymap and the
emulate 3 button mouse produces for this operation and it is independent
of the state of Lock object modes.
Also, as the SculptSession is freed, when using Multires objects go
back to their preview resolution level, so it is possible to work on
high vertex count scenes without slowing down the viewport and other
performance problems.

Reviewed By: #user_interface, pablovazquez

Differential Revision: https://developer.blender.org/D7510
2020-09-18 19:40:40 +02:00
6c9ec1c893 Sculpt: Render Mask and Face Sets with modifiers active
This removes the limitation of the sculpt overlays not being visible
with modifiers active.

Reviewed By: fclem

Maniphest Tasks: T68900

Differential Revision: https://developer.blender.org/D8673
2020-09-18 19:30:51 +02:00
Pablo Dobarro
ea6cd1c8f0 Overlay: Fade Inactive Geometry
This implements a new overlay that blends the bakground color over the
objects that are not in the same mode as the active object, making
them fade with the background.
This is especially needed for sculpt mode as there is no other overlay
or indication in the viewport to display which object is active.

This is intended to be used with D7510 in order to have a faster
workflow when sculpting models with multiple objects.

Reviewed By: fclem

Differential Revision: https://developer.blender.org/D8679
2020-09-18 19:24:58 +02:00
5855f317a7 LookDev: Lock HDRI rotation to View
This adds an option for the HDRI rotation to follow the view rotation.
When this option is enabled, this allows EEVEE materials to be used as
matcaps for sculpting and painting.

This has an extra performance cost when orbiting around the model as the
lookdev cache needs to be recalculated, but in my test it is barely
noticeable.

Reviewed By: fclem

Differential Revision: https://developer.blender.org/D8566
2020-09-18 19:15:15 +02:00
5d728d38b9 Sculpt: Scale Cloth Filter
This filter scales the mesh as it was a softbody, producing folds in the
surface. The orientation of the folds can be controlled using the filter
axis and orientation.

This is an example of a cloth filter that uses deform coordinates instead
of forces, but probably it does not make much sense to expose it to the
user in a different way and with different parameters. I'll remove
FilterCache->enabled_force_axis in a later commit and use always
enabled_axis in SCULPT_filter_zero_disabled_axis_components
for both forces and deformation filters, so this function can also be used
in the mesh filter.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D8661
2020-09-18 19:10:40 +02:00
8ac1ca13c8 Sculpt: Lower the default cloth deformation constraints strength
The deformation constraints strength were too strong and they were
preventing the cloth effects of the brushes with cloth deformation target
to create folds properly. This lowers the default, making the simulation
follow the deformation in a more relaxed way.

I'll make a separate patch to expose this as a property for certain brushes
and cloth deformers that may need higher values (like boundary with loop
falloff on a low poly mesh), but I think this default will work better for
most use cases.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D8884
2020-09-18 19:06:24 +02:00
a0f6da0abc Revert "Fix T79523 Paint Cursor: Wide line not supported on OSX"
This commit caused regression on some sculpt paint cursors. A better
approach is being worked on.

This reverts commit 6ade522f27.
2020-09-18 19:04:00 +02:00
0335c1fd21 GPencil: Implement Holdout materials
This new feature allows to use the strokes as an eraser of any stroke below. This is very handy to open holes in filled areas.

After running some tests, we have decided to keep the additive effect of the holdout color. To get clean holdout areas, just move the color to black to remove any additive effect. To have additive effect can be used in situations like tint slightly a transparent window with blue to simulate the glass.

See T79878 for more details

Differential Revision: https://developer.blender.org/D8932
2020-09-18 18:28:17 +02:00
Brecht Van Lommel
7b988188dc Fix T79929: crashes with Cycles denoising on older Macs
This was a bug in OpenImageDenoise, upgrade to latest 1.2.3 which has the fix.
This in turn required a newer ispc version.

Differential Revision: https://developer.blender.org/D8892
2020-09-18 18:11:32 +02:00
007e90e8c0 Fix T78793, T79707: Cycles crash on macOS with older CPUs
Embree static libraries need additional linking flags to avoid SSE and
AVX symbols getting mixed up.
2020-09-18 18:10:49 +02:00
ff44429421 Fix warning printed when duplicating marker
Steps to reproduce were:
* Create a marker in the timeline
* With the mouse over the marker region, press Shift+D

The function for moving markers was reused and had handling specific to
tweak events. This is not relevant in case of duplicating markers.
2020-09-18 18:05:32 +02:00
ce558a46c1 UI: Correct superimposed icon interaction hotspot
The hotspot was slighly too large, which could be apparent in cases
where there are multiple superimposed icons.
2020-09-18 18:05:32 +02:00
0cac3c79cc Fix T80927: UV Edges Not Visible When Repeat Image Active
When repeat image was active the image was drawn in the foreground
making most uv overlays not visible. This change creates a shared
defined value for repeating and not repeating images.
2020-09-18 18:00:12 +02:00
6303cb7bd0 Fix 80909: Switching to profile bevel can explode Curve geometry
We need to make sure the CurveProfile is initialized with the proper
number of segments when switching to profile bevel mode.
2020-09-18 09:32:09 -05:00
402a4cadba CMake/LLVM: Add INCLUDE_DIRS to find package.
Ref {D8855}

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D8919
2020-09-18 19:14:01 +05:30
b746179d0a CMake/OpenSubdiv: Rename INCLUDE_DIR -> INCLUDE_DIRS.
Ref {D8855}

Unix and Apple platform files use find_package(OpenSubdiv) which sets
`OPENSUBDIV_INCLUDE_DIR` as an advanced variable, as well as
`OPENSUBDIV_INCLUDE_DIRS` which should be used usually.
Windows sets `OPENSUBDIV_INCLUDE_DIR` which is used by the rest
of the code.

This patch renames it to `_DIRS` everywhere, for it to be like other
similar variables.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D8917
2020-09-18 19:12:26 +05:30
df126861b2 Fix T80900: Crash lasso-selecting in particle editmode in certain
situations

In the situation that the PTCacheEdit is not available (e.g. when
editing unbaked Cloth or Softbody caches - or, as in the report, being
in Cloth or Softbody Editing Type for Hair particles), accesing the
corresponding ParticleSystem or ParticleSystemModifierData would crash.

Now access these later (after PE_start_edit had the chance to return
early on this non-valid situation).

Reviewers: JacquesLucke

Maniphest Tasks: T80900

Differential Revision: https://developer.blender.org/D8941
2020-09-18 14:24:22 +02:00
a5dccd3320 Fix T80905: GPencil: bones cannot be selected using Ctrl + LMB (with Left Selection Preference)
Was missing a dedicated entry for LMB select, this is to be consistent
with how it is done for meshes.

Maniphest Tasks: T80905

Differential Revision: https://developer.blender.org/D8935
2020-09-18 14:15:43 +02:00
32678e8654 Cleanup: remove unused navmesh code
These were leftovers from the BGE removal.

Differential Revision: https://developer.blender.org/D8862
2020-09-18 14:10:23 +02:00
a985b8bd9e Fix T80437: Auto IK Double Generates IK constraints
Caused by rB9a7f5f1bb422.

If using Auto IK (or targetless IK and Auto IK together), two temporary
constraints were added.
- from pose_grab_with_ik_add (even for targetless IK)
- from add_pose_transdata (even for Auto IK)

Since both both do similar things, but cannot work in tandem (with
possibly different chainlengths for example), we have to decide which
type to prefer over the other (as in: do not create a constraint for the
other).
It seems better to ignore the 'Auto IK' option on bones that will
have targetless IK set up for them specificallly [e.g. defining special
chainlength]. This way you can still work with 'Auto IK' ON generally
[with interactive chainlength control], but also have specific bones that
need their own custom chainlength.

For now, the most straightforward fix is to
- only add constraints for Auto IK from pose_grab_with_ik_add()
- only add constraints for targetless IK from add_pose_transdata()

Note: this area has some potential for later refactoring:
- move creation of all temporary constraints to a single place
[preferably pose_grab_with_ik_add]
- use only those temporary constraints in transform code [atm. we still
flip CONSTRAINT_IK_AUTO around on the "original" -- unneccesarily, after
rB9a7f5f1bb422 a dedicated temporary constraint is now always available]
- clarify CONSTRAINT_IK_AUTO vs. CONSTRAINT_IK_TEMP
- obeying standard rotation locks on bones in the chain (not just the
the IK locks) is not consistent between targetless IK and Auto IK

Potential candidate for 2.90.1 as well as 2.83 LTS

Maniphest Tasks: T80437

Differential Revision: https://developer.blender.org/D8930
2020-09-18 13:18:19 +02:00
9a5663ff43 Cycles: Add time report for Blender data synchronization
Allows to more easily access time information about how long Cycles
did spend synchronizing objects from evaluated depsgraph on Blender
side to its own structures.

This timer does not include time spent evaluating render depsgraph.
2020-09-18 12:03:22 +02:00
940ef1a4e8 EEVEE: Fixed Compilation Error
Regression from {b248ec97769f}. A new parameter was introduced, but the
stub shader macros still had the old number of parametes. This
change adds a new dummy parameter to the stub macros.
2020-09-18 10:39:32 +02:00
7bfcd99a90 Fix T80904: GPencil: bones cannot be transformed when in weightpaint
mode

The transform convert of type TC_POSE was not being defined if the mode
was OB_MODE_WEIGHT_GPENCIL.

Maniphest Tasks: T80904

Differential Revision: https://developer.blender.org/D8934
2020-09-18 10:15:02 +02:00
bda6eb1e27 Fix T71383: Error setting the windows workspaces from Python
Assigning window variables relied on notifiers that always used the
active window, no matter the window being assigned.

Pass the current window to the notifier.
2020-09-18 17:57:54 +10:00
9a52b30cc0 UV: select face loops when in face-select mode
Match edit-mesh behavior.
2020-09-18 16:04:43 +10:00
338ebea53e Cleanup: remove unused global locks from BLI_threads 2020-09-18 15:31:12 +10:00
e6978f4d63 Fix T80885: Texture paint camera project crashes after undo/redo
Unmatched ED_image_undo_push_{begin/end},
add doc-strings noting why this is needed.

Thanks to @Baardaap for the initial fix.
2020-09-18 14:38:23 +10:00
14b2de37db UI: Refactor panel alignment function
This code had grown overly complicated and hard to understand.
The improvements in this commit:
 - Avoid allocating a duplicate of every active panel.
 - Instead of complicated logic to calculate each panel's offset,
   just keep track of the current offset while iterating through.
 - More readable code structure, better comments.

Note that calcuting the X offset here is a relic from pre-2.5 when
panels could be aligned horizontally. I kept this in, but it would
be reasonable to remove it in the future.
2020-09-17 23:15:20 -05:00
aa2219285c Cleanup: Rename variables in panel alignment code
This makes these variable names more consistent with current standards,
mostly by not over-abbreviating already short words. The following commit
will refactor this function.
2020-09-17 22:58:07 -05:00
0e78dacb4d Cleanup: change enum usage so types are explicitly listed
Structure switch statements so new missing items cause warnings.
2020-09-18 11:15:12 +10:00
1dda60792c Cleanup: use 'UI_icon_*' prefix for icons API
- UI_collection_color_icon_get -> UI_icon_color_from_collection
- UI_idcode_icon_get           -> UI_icon_from_idcode
- UI_library_icon_get          -> UI_icon_from_library
- UI_mode_icon_get             -> UI_icon_from_object_mode
- UI_rnaptr_icon_get           -> UI_icon_from_rnaptr
- UI_alert_image               -> UI_icon_alert_imbuf_get
- UI_preview_render_size       -> UI_icon_preview_to_render_size
- UI_id_icon_render            -> UI_icon_render_id
2020-09-18 10:24:14 +10:00
cacd57b67a Fix T80771: Avoid changing the visibility of loose geometry when entering Sculpt Mode
When entering scultp mode the visibility from the Face Sets is copied to
the base mesh. This steps was considering that if a vertex belongs to a
face with a visibible Face Set ID, it should be visible. As loose
geometry may not have any faces, those vertex were set to hidden.

Now this function check if a vertex visibility should be modified by the
face sets (by checking the loops), avoiding modifying the visibility of
loose geometry unintentionally.

Reviewed By: sergey

Maniphest Tasks: T80771

Differential Revision: https://developer.blender.org/D8899
2020-09-17 23:51:21 +02:00
Pablo Dobarro
adfbb77b20 Fix Brushes with deformation target being affected by sim areas
Brushes that target the cloth simulation but are not the cloth brush
affect the entire mesh, so they don't have simulation areas and falloff.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D8885
2020-09-17 23:46:36 +02:00
Pablo Dobarro
459fd1814c Fix bad allocation in mask sculpt gestures
Reviewed By: sergey

Differential Revision: https://developer.blender.org/D8886
2020-09-17 23:44:54 +02:00
39de0b79fd Pointclouds: support mesh <-> pointcloud in convert operator
Just converts verts to points and vice versa.
Materials and Attribute layers are preserved (so for example if you set
custom radii on the pointcloud, convert to mesh, then convert back to
pointcloud, this will be preserved).

Also not add a Radius layer by default (it is still added and
filled when adding a pointcloud object from the menu), a global Radius
property that will be used if there is no radius attribute can be added
later. A Radius attribute can also be added in the pointcloud data
properties (and filled via python).

This will also add a new utility function that copies materials between
datablocks: BKE_id_materials_copy

ref T75717

Differential Revision: https://developer.blender.org/D7391
2020-09-17 22:39:57 +02:00
9ee588cd4a Cleanup: Correct comments 2020-09-17 15:18:24 -05:00
1f9e3d44a0 Cleanup: Doxygen sections 2020-09-17 13:14:47 -05:00
66d7f9c8f0 Cleanup: remove unneeded check in uiTemplateConstraintHeader
Following rB7a0a60dde8b4, checking for temporary IK constraints in
uiTemplateConstraintHeader is not needed anymore (since the whole panel
will now be skipped earlier for those).

Differential Revision: https://developer.blender.org/D8902
2020-09-17 19:30:46 +02:00
627132496d Fix T80131: Rigid Body World Field Weights dont have a proper RNA path
(e.g. cannot be animated)

An RNA path is mandatory for RNA_path_from_ID_to_property, and for
EffectorWeights, this has to be provided using RNA_def_struct_path_func
(since this struct is shared across ParticleSettings, Modifiers and Rigid
Body World). Without this, the animation system cannot work and e.g.
keyframes cannot be inserted.

The case for Rigid Body World in rna_EffectorWeight_path was missing,
now added.

Rigid Body World Field Weights are capable of being animated, tested
with file from T80131 (e.g. gravity, wind).

Maniphest Tasks: T80131

Differential Revision: https://developer.blender.org/D8713
2020-09-17 19:21:39 +02:00
Alex Strand
b248ec9776 Shaders: add emission strength input to Principled BSDF node
This impacts I/O add-ons. OBJ, FBX and Collada have been updated, glTF not yet.

Differential Revision: https://developer.blender.org/D4971
2020-09-17 18:54:04 +02:00
65fd005312 Cleanup: Extract "draw_fcurve" as a separate function
This is reasonable to do by itself, but it also enables drawing fcurves
outside of this loop, which is useful for D7737.
2020-09-17 11:30:41 -05:00
5b7a35ddfb Cleanup: Use "r_" prefix for return arguments 2020-09-17 11:06:41 -05:00
08a3f01ddc macOS: Added potrace in platform apple cmake
Ref T80818

Reviewed By: brecht

Maniphest Tasks: T80818

Differential Revision: https://developer.blender.org/D8922
2020-09-17 17:32:39 +02:00
Ankit Meel
f37c83a12b CMake/Potrace: Fix capitalization, silence warning.
The `find_package()` callers expect the library name as `Potrace`, not
`POTRACE`.

Reviewed By: LazyDodo

Differential Revision: https://developer.blender.org/D8923
2020-09-17 19:45:20 +05:30
3a92a2df45 Add versioning for 2.90 files that may have invalid mesh
rBf2d26409e83b fixed a serious problem with invalid mesh after an
operation with the extrude manifold.

Since BKE_mesh_validate_arrays is a slow operation, the chosen
interval between versions is relatively small and also only the
mentioned invalid mesh problem is tested.

Differential Revision: https://developer.blender.org/D8898
2020-09-17 11:10:58 -03:00
82bd1287dd Cleanup: reduce variable scope 2020-09-17 14:10:54 +02:00
393b5a231f Cleanup: Misplaced fullstop in comment 2020-09-17 13:33:53 +02:00
ef4877fde3 Fix error in fix for T66256, not clearing the exception 2020-09-17 21:12:35 +10:00
3dbb231ed2 Fix OpenCL render error in large scenes
In scenes such as Cosmos Laundromat, there were memory allocations bigger than
2GB which would overflow.

Problem and solution found by AMD, thanks!
2020-09-17 13:07:28 +02:00
Brecht Van Lommel
532ac1163c Tests: bundle tests for some modules in their own executables
The ffmpeg, guardedalloc and blenlib are quite isolated and putting them in
their own executable separate from blender_test is faster for development than
linking the entire blender_tests executable.

For Cycles, this also bundles all the unit tests into one executable.

Ref T79958

Differential Revision: https://developer.blender.org/D8714
2020-09-17 12:29:19 +02:00
f9fcb25d52 CMake: clean up setting of platform specific linker flags
Set flags directly on the target, and use common function for all cases.
This refactoring helps with the next commit for test executables.

Ref D8714
2020-09-17 12:29:19 +02:00
0700c045bc Fix: re-do versioning code for FCurve extremes and Collection colors
Bump Blender subversion from 4 to 5, and re-execute some versioning code.

Because of a mistake in the versioning code (corrected in rB1a4fc6dcd67b),
some of the versioning code didn't run in certain cases. This subversion
bump ensures that this code is still run.
2020-09-17 12:02:05 +02:00
157cd6c6e8 Make deps: Compile own nasm for Linux
This solves annoyance that the official RPM repository of nasm requires
newer version of rpm tool compared to what is shipped by default with
centOS 7.

Differential Revision: https://developer.blender.org/D8905
2020-09-17 11:02:27 +02:00
d377b1fe76 Cleanup: remove deprecated PyEval_InitThreads use
Deprecated in Python 3.7
2020-09-17 19:00:48 +10:00
76f99bd13a Fix T66256: Context overrides crash when operators change context
Using context overrides in Python caused problems for any operator that
changed the context and require these changes to be read back.

CTX_wm_area_set() for e.g. would set the struct member but future
calls to CTX_wm_area() would still return the value defined by Python
callers context overrides.

This also resolves a mismatch between polling and calling operators
from Python, where poll would override the Python context where calling
only overrode the context when a new context was passed in.
2020-09-17 18:53:00 +10:00
f085ebba58 Cleanup: use doxy sections for blender.c 2020-09-17 15:34:10 +10:00
8e0fc27722 Cleanup: use static assert to disable access to preferences
Prefer this over an unknown identifier as it gives a useful error.
2020-09-17 15:24:58 +10:00
8dd5902e1e Cleanup: Use enum instead of defines for panel runtime flag
Discovered an unused panel runtime flag as well, which this commit
removes.
2020-09-16 23:47:09 -05:00
4b20eebb85 UI: only draw a single header in the header region
While this isn't an issue with the default configuration it's possible
to register extra header types for a single region.

In this case the first header-type to successfully poll is drawn
without drawing other header types.

This issue was raised by T60195.
2020-09-17 14:43:28 +10:00
3fb7e5df50 Cleanup: don't register dope-sheet header types
These are only used to hold static methods, there is no reason to
register them.
2020-09-17 14:43:28 +10:00
7a1c405bb4 Cleanup: Comment formatting in interface_panel.c
Also cleaned up some grammar and wording issues, and switched a case
in an if statement to remove a double negative.
2020-09-16 22:56:29 -05:00
971fe43d06 Fix T63651: ImagePreviewCollection.new,load don't work as documented
Update doc-strings, add note for why this decision was made.
2020-09-17 12:44:46 +10:00
70eb24a575 Cleanup: warning (missing-braces) 2020-09-17 11:59:51 +10:00
27660b3cd9 Fix: Text object custom profile bevel not written to file
The CurveProfile struct was only being written to the file for regular
curve objects. Caused by an incorrect merge of master before committing.
2020-09-16 16:05:17 -05:00
6ade522f27 Fix T79523 Paint Cursor: Wide line not supported on OSX
This replace the use of GPU_line_width by the specialized
GPU_SHADER_3D_POLYLINE_UNIFORM_COLOR shader.
2020-09-16 20:27:32 +02:00
1fb7f36acb Fix T79315 Normals Overlays broken with hidden geometry
Was caused by non-initialized variables before a return inside
the vertex shader.
2020-09-16 20:17:03 +02:00
5cf6f5e66d Fix: Property search crashes searching enums with separators 2020-09-16 13:05:28 -05:00
Ankit Meel
6759b8a224 Cleanup: silence [-Wmissing-braces] warning.
Introduced in {rBd6525e8d133b787655bdb2c2fcef218591a457c3}

Compiler: Apple LLVM version 10.0.1 (clang-1001.0.46.4)
Target: x86_64-apple-darwin18.7.0
Thread model: posix
```
source/blender/draw/engines/image/image_shader.c:46:13: warning:
suggest braces around initialization of subobject [-Wmissing-braces]
} e_data = {0}; /* Engine data */
            ^
            {}
1 warning generated.
```

Reviewed By: jbakker

Differential Revision: https://developer.blender.org/D8873
2020-09-16 23:22:55 +05:30
60fa80de0b Curves: Add custom profile bevel support
This adds support for the same custom bevel profile widget used in
the bevel tool and modifier to the geometry generation for curves.

This is expecially useful for text and 2D curves with extrusion, as
it works much better than a weld & bevel modifier combination.
It can also be useful for adding quick detail to pipe-like objects.

The curve holds the CurveProfile struct and a new "Bevel Mode"
property decides which type of bevel to build, round, object, or
custom profile.

Although curves can already use another curve to make the bevel
geometry, this is a quicker way, and it also defines the profile of
just one corner of the bevel, so it isn't redundant. It's also nice
to have the same custom profile functionality wherever there is bevel.

Differential Revision: https://developer.blender.org/D8402
2020-09-16 10:20:38 -05:00
365271a588 Fix tests after adding collection color tagging
Fix a segfault caused by assuming all scenes have a master collection
when applying versioning to old files.
2020-09-16 09:07:04 -06:00
0696eaa3e8 Fix T80684: Node shader wrapper: Tweak handling of alpha textures.
There is no ideal solution here, but we can assume by default that we should
use the Alpha output from a texture used for transparency data.

This will break people using a dedicated B&W texture for this alpha
pass, but we cannot really handle all cases properly in this wrapper, we
only try to support the most common ones to some extent.
2020-09-16 16:39:49 +02:00
1a4fc6dcd6 Fix versioning code after FCurves versioning not executed
There must not be any return directly in our versioning patches. It
would return from the entire versioning function.
Mistake in da95d1d851.

As a result, when opening old files with animation data, the versioning
for the new collection color tagging wouldn't run, and all collections
would get the first color assigned.
2020-09-16 15:56:39 +02:00
Chris Clyne
c9c0f89307 Action Constraint: Add manual time factor input control
Adds an optional slider to the action constraint so that it can be
driven without a constraint target.

This is very helpful for more complex rigging and mechanical rigs, as it
means the action constraint can be controlled with a driver/custom
property directly, currently if we want to use a driver to control it we
must add a "dummy" bone/object inbetween to act as a control.

Reviewed By: Sebastian Parborg, Sybren A. Stüvel, Demeter Dzadik, Julian Eisel

Differential Revision: http://developer.blender.org/D8022
2020-09-16 15:55:22 +02:00
569e2e6dba GPUDebug: Avoid using STREQ on StringRef
This might be dangerous because StringRef is not guaranteed to be
null-terminated and STREQ assumes null termination.
2020-09-16 15:24:37 +02:00
fa81e36f65 Fix T78653 Workbench: Broken Depth of Field in Viewport (Mac OSX)
The output layout was wrong and it's a mistery why it works on most
implementations since it's clearly a wrong usage.

Thanks @sebbas for helping narrowing down the issue.
2020-09-16 15:17:58 +02:00
fa2ef64d96 Fix (unreported) buffer overflow in BLI_system_cpu_brand_string helper.
Since this buffer is used as an array of 12 32bits integers, and C++
string expect a NULL-terminated C-string, we need an extra char to
ensure last one is always NULL.

See D8906. Thanks to @brecht for noting this one too.
2020-09-16 15:04:19 +02:00
Wayde Moss
d067c13a9d NLA: Always Show All Strips
Currently, it's difficult to use the NLA system for users who are only
interested in using it as animation layers.

Entering tweak mode hides strips which are not evaluated. If the user
wanted to edit a different strip, they must exit tweak mode, look for
the strip, select it then re-enter tweak mode.

Solution:
All strips are always shown. The user can now see the next strip they
want to start editing.

Reviewed By: Sybren, Sebastian Parborg

Differential Revision: http://developer.blender.org/D7600
2020-09-16 14:52:48 +02:00
be11603dc2 Fix (unreported) buffer overflow in Cycles' system_cpu_brand_string helper.
Since this buffer is used as an array of 12 32bits integers, and C++
`string` expect a NULL-terminated C-string, we need an extra char to
ensure last one is always NULL.

See D8906. Found while investigating T80657.
2020-09-16 14:39:13 +02:00
f14995aba7 Fix: add versioning to fix incorrectly written customdata
Reviewers: campbellbarton

Differential Revision: https://developer.blender.org/D8903
2020-09-16 12:26:16 +02:00
27a5da4dc3 Cleanup: use uint8_t for various flags in curves
Previously, it was kind of a mess. In different places it was using `char`, `short` and `int`.

The changed properties are flags that are operated upon using bit operations. Therefore, the integer type should be unsigned. Since we only use 2 bits of these flags, `uint8_t` is large enough.

Especially note the change I had to make in `RNA_define.h` to make this work.

Reviewers: campbellbarton

Differential Revision: https://developer.blender.org/D8844
2020-09-16 12:23:23 +02:00
d376aea618 Fix: Showing Meta Data Crash
When Showing Meta data for an image where the buffer does not exist
(missing file) it crashed. This patch removes the check on the image and
only checks the availability of the buffer.
2020-09-16 11:55:48 +02:00
c5c22d1ce1 Install_deps: update to add pugixml and potrace new deps.
Also fixed OpenVDB maximum version, it appears that even 7.1 is not
compatible with 7.0?

Re T80818 and D8628.
2020-09-16 11:23:58 +02:00
7cae58adf5 Fix T80800: Active UVMap Drawing
Regression introduced by D8234. In stead of using the active uv map, the
render uv map was drawn. This change will use the active uv map.
2020-09-16 11:19:47 +02:00
ba85b4e45c Fix: create shallow copy of CustomData before writing
CustomData_blend_write_prepare might modify the `CustomData`
instance, making it invalid afterwards. It is not necessary to do this
in other cases explicitly, because when writing shallow copies of
ID data blocks are made.
2020-09-16 10:39:04 +02:00
cee6518b5e Fix T80825: UV Editor UV Grid
Regression introduced by D8234.
2020-09-16 10:35:18 +02:00
7e8cba98b6 Cleanup: spelling 2020-09-16 15:28:02 +10:00
c7309c5007 Cleanup: use doxygen links to struct members 2020-09-16 15:17:44 +10:00
75b52da826 Cleanup: DNA_fluid_types: Add DNA member name before enum declarations 2020-09-16 02:02:57 +02:00
e4eb1a71ee Fix building with tests enabled 2020-09-16 02:02:57 +02:00
17ccb409dd Bump file subversion after recent theme-related changes 2020-09-15 18:47:35 -05:00
Red Mser
675807e2b6 UI: Add grid-related theme options
This commit makes grid theming more consistent and capable by adding
some new theme colors related to grid rendering.
 - Add grid theme color for node editor. `UI_view2d_multi_grid_draw`
   is called with TH_GRID instead of a shaded `TH_BACK`.
   Also color-blend `TH_NODE_GROUP`.
 - Make the movie clip editor's clip preview grid respect grid theme
   color (`ED_region_grid_draw` uses color-blended `TH_GRID`).
 - Add versioning code to allow fixing existing themes (the resulting
   themes should visually look the same as before)

These changes did cause some inconsistencies in the movie clip editor,
even after adjusting the themes accordingly:
1. The alpha slider of the grid color affects the background and not
   the grid lines themselves.
2. The grids used by graph and dopesheet mode could already be themed
   in the past. Now that the clip preview's grid can also be themed,
   two different modes share the same theme color.

Differential Revision: https://developer.blender.org/D8699
2020-09-15 18:42:38 -05:00
1858535a10 GPUShader: Add meaningful debug names to builtin shaders
This makes the debugging easier.
2020-09-16 01:40:45 +02:00
0dd44f4647 GPU: Add debug groups inside selection code
This makes the debugging easier.
2020-09-16 01:40:45 +02:00
926b426073 GPU: Add debug groups inside wm_draw.c
This makes the debugging easier
2020-09-16 01:40:45 +02:00
8eda18f789 GPUDebug: Add function to test if inside a debug group
This is a nice way to check certain GPU codepaths only for some
regions or callers paths.
2020-09-16 01:40:45 +02:00
fafc1fbd7f Fix T80107 Selection: Regression in Box selection
The Draw State now needs to be in sync with what the selection
code set. We query the state just before locking it.
2020-09-16 01:40:45 +02:00
6624c4c225 Fix T75061 Grease Pencil: MacOS: broken Gradient and Texture
There is a driver bug that makes all the end of the structure unreadable.
Workaround this by just declaring a vec4 an unpacking manually.
2020-09-16 00:03:12 +02:00
1572da858d Outliner: Modifier/constraint/shaderfx drag and drop operator
This adds an operator to allow drag and drop of modifiers, constraints,
and shader effects within the outliner. Referred to as "data stack" in
the code for simplicity.

The following operations are allowed:
* Reordering within an object or bone
* Copying a single modifier/constraint/effect to another object or bone
* Copying (linking) all modifiers/constraints/effects to another object
  or bone.

This complements the recent work done for panel-based modifier layouts
by allowing reordering in the outliner. It also makes it simple to copy
a single modifier/constraint/effect to another object.

Differential Revision: https://developer.blender.org/D8642
2020-09-15 15:29:59 -06:00
583354e9e9 Modifiers: Add link and copy functions
Adds functions to copy a modifier between objects, and an ED_ level
function for linking modifiers between objects. This will be used in
outliner modifier drag and drop.

These functions support both regular and grease pencil modifiers.

Differential Revision: https://developer.blender.org/D8642
2020-09-15 15:29:19 -06:00
f4a2024c44 Constraints: Add link and copy functions
Add functions to copy a single constraint between objects or between
bones, and another function to link constraints. This is in preparation
for constraint drag and drop in the outliner.

Differential Revision: https://developer.blender.org/D8642
2020-09-15 15:29:19 -06:00
4d04a345a6 Cleanup: Move notifiers to move_to_index functions
Move the notifiers and DEG tagging to the ED_* level functions for
modifiers and gpencil shaderfx in preparation for outliner modifier and
shaderfx drag and drop. No functional changes.

Differential Revision: https://developer.blender.org/D8642
2020-09-15 15:29:19 -06:00
a6434ff417 Cleanup: Extract editor function from constraint_move_to_index_exec
No functional changes. Move the constraint reordering logic into an ED_
level function to be used by outliner constraint drag and drop.

Differential Revision: https://developer.blender.org/D8642
2020-09-15 15:29:19 -06:00
18701c19fa GPencil: Add link and copy functions for shaderfx
Adds two functions: one to copy a shaderfx between two gpencil objects,
and another to link all shaderfx between two gpencil objects. Added in
preparation for outliner shaderfx drag and drop.

Differential Revision: https://developer.blender.org/D8642
2020-09-15 15:29:19 -06:00
1c5d0deb2a Cleanup: Separate BKE_object_link_modifiers into functions
No functional changes. Split the grease pencil and object copy logic
into separate functions. This makes the code cleaner and prepares
utility functions for outliner modiifier drag and drop.

Differential Revision: https://developer.blender.org/D8642
2020-09-15 15:29:19 -06:00
cf0791bf38 Property Search: Properly set expansion for instanced panels
Stack panels (for modifiers, etc..) also get their expansion from their
associated list data. This means that property search expansion needs
to properly update the list data, which can be accomplished by calling
`set_panels_list_data_expand_flag`.

This commit also moves this logic to `UI_panels_end`, where it fits
better.
2020-09-15 15:57:30 -05:00
Ankit Meel
a4c5811e21 ASan/macOS: fix incomplete C/CXX compiler flags.
While testing for {rB40dcf686f04f}, compiler flags got mixed up and
non-working ASan configuration was committed.

Platform file, which is `include`d after the `CMAKE_C_FLAGS_DEBUG` etc.,
are set, overwrites those flags instead of appending to them. To fix this,
`PLATFORM_CFLAGS` is used to pass the `-fsanitize=*` flags to the C/C++
compiler.

Tested on fresh build using both Xcode and Ninja, with & without ccache.

Also silence a clang warning for multi-config generators:
the object size sanitizer has no effect at -O0, but is explicitly
enabled: -fsanitize=object-size [-Winvalid-command-line-argument]

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D8879
2020-09-16 02:18:59 +05:30
Ankit
84032fd110 GMP/macOS: silence "PIE disabled" linker warning.
The change builds GMP with `--with-pic` flag on non-arm architecture.

The warning:
ld: warning: PIE disabled. Absolute addressing
(perhaps -mdynamic-no-pic) not allowed in code signed PIE, but used in
___gmpn_divexact_1 from lib/darwin/gmp/lib/libgmp.a(dive_1.o). To fix
this warning, don't compile with -mdynamic-no-pic or link with
-Wl,-no_pie

Reviewed By: sebbas

Differential Revision: https://developer.blender.org/D8823
2020-09-16 02:05:51 +05:30
8aab26b3b3 UI: Refactor some list panel expansion code
This commit moves the "get panel expansion from list data" function to
UI_panels_end, which is an improvement because it's more centralized.
2020-09-15 15:34:27 -05:00
2eec6ec793 Deps: Add potrace as a new library dependency
For work the GP team plans to land soon (T79877) potrace was taken
on as an additional optional dependency.

This diff adds building the library to the deps builder and takes
care of the integration into the build-system with the `WITH_POTRACE`
cmake switch.

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

Reviewed by: brecht, sergey
2020-09-15 13:16:37 -06:00
7b3d38a72d Outliner: Hierarchy line drawing
Adds a new hierarchy line that draws to the left of collections. If the
collection is color tagged, then the hierarchy line is drawn in that
color. This is useful to see the color tag of a collection that exceeds
the vertical height of the outliner when expanded.

This also modifies the object hierarchy line drawing to match the new
collection hierarchy line, with no horizontal lines, and moved a unit to
the left. Object lines are not drawn colored.

Manifest Task: https://developer.blender.org/T77777

Differential Revision: https://developer.blender.org/D8622
2020-09-15 12:47:10 -06:00
16f625ee65 Outliner: Draw colored collection icons
This replaces the collection icon with the filled collection icon.

If the collection is color tagged, then the icon draws in the tagged
color.

Manifest Task: https://developer.blender.org/T77777

Differential Revision: https://developer.blender.org/D8622
2020-09-15 12:47:10 -06:00
33d7b36cec Outliner: Set collection color tag operator
This adds a new operator to the outliner context menu. The collections
context menu now shows inline icons to set the color tag for all
selected collections.

Manifest Task: https://developer.blender.org/T77777

Differential Revision: https://developer.blender.org/D8622
2020-09-15 12:47:09 -06:00
26a40ac8fa UI: Fix spacing of inline row icon buttons
A follow-up to rbe17df47303e1. Fix the horizontal spacing of aligned row
icon buttons in menus.
2020-09-15 12:47:09 -06:00
4c3813fb32 UI: Show color tagged collection icons in menus
Draw color tagged collection icons in the link to collection, add
collection instance, collection instance search, and remove collection
menus.

Manifest Task: https://developer.blender.org/T77777

Differential Revision: https://developer.blender.org/D8622
2020-09-15 12:47:09 -06:00
452a1c7b38 Collections: Add color tagging
This adds color tagging to collections. There are 8 color
options which are themable in the user preferences, with an additional
option for no color tag by default.

This adds a new filled collection icon and 8 colored variants of the
icon that can be themed in the user preferences.

In this commit the only interface to setting the color tags is through
Python, and there is nowhere in the interface where the collections are
shown colored. Setting and viewing the color tags from the outliner will
follow.

Manifest Task: https://developer.blender.org/T77777

Differential Revision: https://developer.blender.org/D8622
2020-09-15 12:47:09 -06:00
f137022f99 Liquid Simulation Display Options (GSoC 2020)
All the changes made in the branch `soc-2020-fluid-tools` are included in this patch.

**Major changes:**

=== Viewport Display ===

- //Raw voxel display// or //closest (nearest-neighbor)// interpolation for displaying the underlying voxel data of the simulation grids more clearly.
- An option to display //gridlines// when the slicing method is //single//.

==== Grid Display ====

- Visualization for flags, pressure and level-set representation grids with a fixed color coding based on Manta GUI.

==== Vector Display ====

- //**M**arker **A**nd **C**ell// grid visualization options for vector grids like velocity or external forces.
- Made vector display options available for external forces.

==== Coloring options for //gridlines// ====

- Range highlighting and cell filtering options for displaying the simulation grid data more precisely.
- Color gridlines with flags.

- Also, made slicing and interpolation options available for Volume Object.

Reviewed By: JacquesLucke, sebbas

Differential Revision: https://developer.blender.org/D8705
2020-09-15 23:13:01 +05:30
bedbd8655e Property Search: Quick start and clear operators
`ctrl-F` to start the search is obviously necessary, but the clear
operator, `alt-F` requires some of explanation. First, it maps nicely
to the paradigm of "key to set, alt-key to clear," which makes it
unobtrusive. Second, it can be a quicker way to clear the search than
moving the mouse to the top. Finally, in the future, it could a reset
the panels to their expansion before the search started.

Differential Revision: https://developer.blender.org/D8857
2020-09-15 11:39:25 -05:00
8bcdcab659 UI: Single tab property search
This adds a search bar to the properties editor. The full search for
every tab isn't included in this patch, but the interaction with
panels, searching behavior, UI, region level, and DNA changes are
included here.

The block-level search works by iterating over the block's button
groups and checking whether they match the search. If they do, they
are tagged with a flag, and the block's panel is tagged too. For
every update (text edit), the panel's expansion is set to whether
the panel has a result or not. The search also checks for matching
strings inside enums and in panel labels.

One complication to this that isn't immediately apparent is that
closed panel's subpanels have to be searched too. This adds some
complexity to the area-level panel layout code.

Possible Future Improvements:
 - Use the new fuzzy search in BLI
 - Reset panels to their expansion before the search started if
   the user escape out of the text box.
 - Open all child panels of a panel with expansion.

Differential Revision: https://developer.blender.org/D8856
2020-09-15 11:25:49 -05:00
7a0a60dde8 Dont show temporary IK constraints in the constraint stack
Those constraints are added when using AutoIK (or targetless IK as
well).
While not strictly incorrect, these kinds of constraints were not
showing in the UI prior to rBeaa44afe703e (and I think they should not).

ref T80437

Maniphest Tasks: T80437

Differential Revision: https://developer.blender.org/D8895
2020-09-15 17:57:37 +02:00
2b36e6bee6 Fix T80333: cursor disappears after using navigation gizmo in editmode
Caused by rBe490dc4346db: UI: Skip unnecessary cursor setting

Above commit returned early if the cursor was already set, but did this
before visibility was regained, now return (still early) after setting
visibility.

Reviewed by @Severin in T80333
2020-09-15 17:50:45 +02:00
f59ce4d55c Property Search: Add "search match" theme color
We will use a highlight on panel headers to convey that they have
a search match, so this commit initializes the theme color for the
properties editor.

Differential Revision: https://developer.blender.org/D8854
2020-09-15 10:34:38 -05:00
6b29c3fa07 Property Search: Move properties context buttons back to a panel
The context path "breadcrumbs" used to be in a panel in 2.79.
Although they look a bit better in the header, there isn't enough
space for them with the property search field in the header as well.

Maybe there will be another solution in the long term to fit both
the search field and this panel in the header, but for now, this
commit moves these labels back to a header-less panel.

Differential Revision: https://developer.blender.org/D8853
2020-09-15 09:50:14 -05:00
67e630609b Property Search: Build button groups for Search
This is needed for property search (upcoming patch D8856) where a
buttons labels are often separate buttons, but we need to highlight
the label to show that a property is a search result. This is
especially important in "property split" layouts where the label is
almost always another button in a separate column.

The button groups here are basically a flattened view of the buttons
in the layout tree. Every function that adds a new set of buttons
creates a new button group, and the new buttons are automatically
added to the most recent group. Then, each group is searched
separately in the property search phase. It's important that every
function adding a new button set calls layout_root_new_button_group.

Note that this won't be disabled when property search isn't active.
It may be useful for other things in the future, and trying to pass
that information to layout functions didn't feel worth it to me.

Differential Revision: https://developer.blender.org/D8783
2020-09-15 09:38:19 -05:00
f886e13836 Cleanup: Remove unneeded parameter
A parameter was added during development, but it was not needed and was
never removed. No functional changes.
2020-09-15 08:11:55 -06:00
dedd9ce0aa Fix T80787: Fix White edges when rendering transparent smoke
The UV/Image editor was doing interpolation including over the alpha
value what makes will render incorrectly when interpolating between pure
emissive colors and pre multiplied colors. This change disabled the
interpolation.
2020-09-15 15:43:19 +02:00
93b8040f57 UI: Add icon_only argument to operator_enum
Add an option to only draw icons for operator_enum menus. This is used
for drawing inline icon buttons in the outliner context menu for
collection color tagging.

Part of T77408

Differential Revision: https://developer.blender.org/D8880
2020-09-15 07:40:38 -06:00
e17df47303 UI: Add support for row-aligned icon buttons in menus
This adds support for drawing icon buttons as a row in menus. This is
needed for drawing collection color tagging icons in the outliner
context menu in T77777.

Part of T77408

Differential Revision: https://developer.blender.org/D8317
2020-09-15 07:26:08 -06:00
13c7df1054 Fix T80193 Sequencer: Crash on float images when OCIO GLSL shader can't be used
This was just an oversight from refactoring this code in
rBfaeaf5325554e37981424ded5add7bf2df484c55
2020-09-15 15:22:26 +02:00
9f12ea496a Fix T80477: Crash when rendering with Embree but denoising with OptiX
Commit 009971ba7a changed it so Cycles creates a separate
Embree device for each Cycles device, but missed the multi-device case. A multi-device with
Embree BVH can occur when CPU rendering is used with OptiX denoising and BVH creation then
failed to get a valid pointer to the Embree device, which crashed. This fixes that by providing the
correct device pointer in the multi-device case as well.
2020-09-15 14:58:19 +02:00
cd849076d2 Fix T80681 Wireframe is not visible on square planes with 16384 quads
Fix wrong logic.
2020-09-15 14:56:02 +02:00
dd25d47e8a Cleanup: add missing headers to CMake, formatting 2020-09-15 22:53:44 +10:00
7177a580cc Fix T80630: potential crash in volume grids in Eevee shaders
Found by address sanitizer.
2020-09-15 14:43:50 +02:00
8f7ab26935 Revert "Image Editor: Make Rendering of Pure Emissive Colors Optional"
This reverts commit f492c8d488.
2020-09-15 14:33:22 +02:00
78ea6302f1 Fix T80746: Image blur in compositor creates halo from alpha
When applying alpha, an alpha of 0.0 was always ignored, creating the
Halo
2020-09-15 14:18:35 +02:00
49dbf1324d Image Editor: Deactivate show repeat for UDIM
UDIM textures cannot be repeated, but the option didn't communicate
this. This change makes the Show Repeat option inactive when viewing
Tiled images
2020-09-15 13:33:56 +02:00
TonyG
da95d1d851 Fix T75881: Animation, limitation of Bézier Handles
Relax limits of FCurve Bézier handles during evaluation. FCurve handles
can be scaled down to avoid the curve looping backward in time. This
scaling was done correctly but over-carefully, posing unnecessary
limitations on the possible slope of FCurves. This commit changes the
scaling approach such that the FCurve can become near-vertical.

Bump Blender's subversion from 291.0.1 to 291.0.2 to ensure that older
animation files are correctly updated.

Reviewed By: sybren

Differential Revision: https://developer.blender.org/D8752
2020-09-15 13:08:18 +02:00
fbdac74c40 Cleanup: move versioning code into "until next bump" block
A bit of versioning code was not part of the "Versioning code until next
subversion bump goes here" block, making the diff of an upcoming bump
harder to read. This commit just moves the code to the appropriate spot.

No functional changes.
2020-09-15 12:55:44 +02:00
Wayde Moss
1555b84f6c Fix: NLA, transition to Meta Strip uses wrong time
Copy correct time to temporary strips used for evaluation of NLA
Transition strips.

When a transition is placed next to a meta strip, the transition would
use the wrong strip time, using the time of the meta strip instead of
its own.

Reviewed by: sybren

Differential Revision: https://developer.blender.org/D8287
2020-09-15 12:47:49 +02:00
271f64e358 Fix T54293: calculate mass does not take object scale into account 2020-09-15 12:43:15 +02:00
7b66c719ae Fix T80363: Progress cursor getting stuck 2020-09-15 12:41:26 +02:00
f492c8d488 Image Editor: Make Rendering of Pure Emissive Colors Optional
There are some areas that don't handle pure emissive colors well. For
example erasing alpha using 2d or 3d painting. Or blurring an image in
the compositor.

This patch makes the rendering of pure emissive colors optional. In the
side panel of the Image editor it can still be enabled when needed.

There currently isn't a better place to store it as it is related on how
the image (or a layer of the image) is created. A future design needs to
make sure that the full workflow is supported.
2020-09-15 12:33:49 +02:00
TonyG
60fee78323 Cleanup: FCurve, comments should be sentences
No functional changes.
2020-09-15 11:04:59 +02:00
6c2c89611c Fix T80775: Image Editor Show Metadata Not Working 2020-09-15 11:02:18 +02:00
d8a7d9deeb Fix Unreported: Repeat Image Regression
Regression introduced by c6210f9bac. The vertex shader still used the
old value for the SIMA_DRAW_FLAG_DO_REPEAT.
2020-09-15 10:34:12 +02:00
7b690619dd CleanUp: Fixed incorrect parameters to GPU_depth_test 2020-09-15 10:15:54 +02:00
69c551089b Fix T79534: Python Operator.bl_translation_context ignored
The default value prevented it from being set on registration,
now only assign the default when the class doesn't define it.
2020-09-15 18:08:38 +10:00
ac58663dec Fix T80776: Cannot switch between Slots of Render Result
Introduced by D8234. Added active render slot to determine if the GPUTexture is still up to date.
2020-09-15 09:29:58 +02:00
91e32bff90 Fix T80796: Frame all ignores geometry from instances
Make "Frame All" share functionality with "Frame Selected",
accounting for duplis when calculating the bounds.
2020-09-15 17:00:12 +10:00
56093f7a94 Cleanup: use doxy sections 2020-09-15 15:50:38 +10:00
ed97b466c4 Fix T80443: Object.active_shape_key None after adding a shape
Change BKE_object_shapekey_{insert/remove} to set/clear
the active shape index.

Only set the active index when there are no existing active shapes.
2020-09-15 15:41:06 +10:00
9afadb3a9d Fix T80794: assert naming a new shape key from Python 2020-09-15 15:25:33 +10:00
e86785c514 CustomData: add assert to prevent negative array access 2020-09-15 13:33:34 +10:00
e51ff29919 BMesh: avoid negative array access in shape-key conversion 2020-09-15 13:33:34 +10:00
0b6d7bab5a Cleanup: remove redundant indexing value 2020-09-15 13:33:34 +10:00
971cc0ae03 Cleanup: make it clear WM_main isn't called in background-mode 2020-09-15 13:33:34 +10:00
62f2925e43 Fix T80774: (correction) keep MEM_init_memleak_detection call early 2020-09-15 13:32:00 +10:00
2120acb73e Fix T80774: Leaks reported using '--version' command line argument
Caused by 236ca8fbe8.
2020-09-15 12:46:29 +10:00
61cd0d5bd5 Fix T80597: Assigning material slot from Python console fails
Regression in 12bc34b0b8, add assert so this doesn't happen again.
2020-09-15 11:56:31 +10:00
210c721b4d Cleanup: keymap formatting 2020-09-15 10:55:45 +10:00
d69d811ef9 Cleanup: remove '_' prefix for used arguments 2020-09-15 10:44:50 +10:00
a8fd3df905 Cleanup: spelling 2020-09-15 10:23:41 +10:00
b827d1c530 Cleanup: Split properties editor layout function
Getting the string for a specific context is a basic thing that can be
its own function. This way it can also be reused in other functions.
2020-09-14 18:48:52 -05:00
9a870ccc6a Cleanup: Split off parts of large panel layout function
The ED_region_panels_layout_ex function was quite long, so separating
some pieces of it can make it easier to understand and more modular.
Additionally, the parts that were split off can be reused for future
property search code.
2020-09-14 18:30:50 -05:00
26a827f254 Workbench: Depth Of Field: Fix regression in look and avoid implicit cast
This is a fixup to rB7710de26d0d768734977769af4a278b262f4da51
2020-09-14 23:16:03 +02:00
7710de26d0 Workbench: Depth Of Field: Fix undefined behavior with using texelFetch
On MacOS + Intel Iris Graphics 6100 (may affect other config too), the
texelFetch operation bypass the base mip setting of the texture object.

Using textureLod with lod = 0.0 ensure the lowest (after clamping) mip will
always be selected.

Also disable the texture filtering for this sampler to avoid unecessary
fetches.

This should fix T78653 Blender 2.83 broken Depth of Field in Viewport
2020-09-14 23:05:52 +02:00
f7829787da Fix T80704: bpy.ops.transform.rotate() ignores orient_type
Remove the condition preventing orientation from being obtained out of
the 3d View context.

Also pass the `ob` and `obedit` arguments obtained from the caller.
2020-09-14 15:55:40 -03:00
273bf53e80 Cleanup: Use 'r_' prefix for return value
Make it obvious which values are written to.
2020-09-14 15:55:40 -03:00
f1e34ee7fa Fix T80782 GPU: Curve editing widget point size broken after recent commit
This was caused by a faulty default where program point size was used.
2020-09-14 20:53:34 +02:00
fc2ce8495e Cleanup: GLShader: Use span and default constructor instead of vector(0) 2020-09-14 20:53:34 +02:00
2da4e2be0a Cleanup: GPUDebug: Use Vector instead of custom stack 2020-09-14 20:53:34 +02:00
59a9cf46b4 Fluid: Cleanup bake info string for modular cache
This commit adds a label on top of the bake operator in modular bake mode. This way users will immediately see if their current settings will allow them to bake noise, meshes or particles after baking the simulation base.
2020-09-14 18:58:37 +02:00
177759d818 Make deps: Updated required list of dependencies for macOS
It was possible to drop `nasm` from the list of required macOS dependencies. However, `pkg-config` had to be added - it was required before but probably no one noticed this.

In order to build `external_clang` successfully, `external_xml2` had to be added to the clang dependencies (`c-index-test` was failing).

Note: On Linux `make deps` still seems to require `nasm` installed via apt.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D8870
2020-09-14 17:38:06 +02:00
ac63afca7d GL: Make use of the new debug layer
This makes replay analysis inside renderdoc much easier by using the new
debug group functionality.
2020-09-14 17:30:25 +02:00
a040e8df36 GPU: Add debug groups
Debug groups makes it easier to view from where an error comes from.

The backend can also implement its own callback to make it easier to
follow the API call structure in frame debuggers.
2020-09-14 17:30:25 +02:00
cfd9c0c199 GL: Fix linking errors being useless.
Now they will at least show the shader name
2020-09-14 17:30:25 +02:00
b34ea1d4ce Fix T53073: force destroys particles rotation
See the differential for some more information.

Reviewers: mano-wii

Differential Revision: https://developer.blender.org/D8891
2020-09-14 17:20:39 +02:00
ca3c16ec43 Fix T73590: collection instance offset is not applied correctly
The instance offset should be applied before scaling.
This way the scaling is done from the "collection origin".

Reviewers: zeddb, brecht

Differential Revision: https://developer.blender.org/D8889
2020-09-14 17:18:26 +02:00
716ea15479 Fix T80770: UV Image Editor: Display Texture Paint UVs Not Working
When developing the image draw engine I wasn't aware of this option. But
now it is back.
2020-09-14 15:32:31 +02:00
6aeafacf86 Fix T79651: Bounding box is wrong after duplicate object
The bounding box is not updated in the original object when the function is called using evaluated object and keeps wrong while the object is not edited or the file saved.

Reviewed By: mont29

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

Notes: Minor changes done in the patch following review comments.
2020-09-14 15:26:29 +02:00
ec6d32b238 Fix T78392: [2.83.5, 2.90, 2.91] Crash on undo/ redo after changing modes.
During undo/redo read code is expected to clear the `OB_MODE_EDIT`
bitflag of `Object.mode`, for some reasons.

This was not done anymore for re-used Objects, we need to add a special
handling case for that too.

Should be backported to 2.90 and 2.83 (will probably not be straight
forward for the latter).
2020-09-14 14:59:29 +02:00
4b14f763da Fix 'Links Cut' adding undo steps without cutting anything
The operator's return was ignored by the gesture ops that always
returned `OPERATOR_FINISHED`.

This ends by adding a undo step that brings no change.
2020-09-14 09:42:15 -03:00
d9e2adaaf9 Fix T80728: UV edge select splits UV's for lasso/box/circle select
Oversight in 411c5238a2 ignored sticky selection.

Use 'uvedit_edge_select_set_with_sticky' to make sure
sticky options are respected.

Also skip checking the existing selection since that only checks the
current UV, not all connected UV's which is needed for sticky selection.

The extra checks to avoid updating UV's isn't such an advantage as
only meshed in the selected region are tagged for updating.
2020-09-14 21:19:36 +10:00
ee97add4c4 Alembic export: write custom properties
Write custom properties (aka ID properties) to Alembic, to the
`.userProperties` compound property.

Manifest Task: https://developer.blender.org/T50725

Scalar properties (so single-value/non-array properties) are written as
single-element array properties to Alembic. This is also what's done by
Houdini and Maya exporters, so it seems to be the standard way of doing
things. It also simplifies the implementation.

Two-dimensional arrays are flattened by concatenating all the numbers
into a single array. This is because ID properties have a limited type
system. This means that a 3x3 "matrix" could just as well be a list of
three 3D vectors.

Alembic has two container properties to store custom data:
- `.userProperties`, which is meant for properties that aren't
  necessarily understood by other software packages, and
- `.arbGeomParams`, which can contain the same kind of data as
  `.userProperties`, but can also specify that these vary per face of a
  mesh. This property is mostly intended for renderers.

Most industry packages write their custom data to `.arbGeomParams`.
However, given their goals I feel that `.userProperties` is the more
appropriate one for Blender's ID Properties.

The code is a bit more involved than I would have liked. An
`ABCAbstractWriter` has a `uniqueptr` to its `CustomPropertiesExporter`,
but the `CustomPropertiesExporter` also has a pointer back to its owning
`ABCAbstractWriter`. It's the latter pointer that I'm not too happy
with, but it has a reason. Getting the aforementioned `.userProperties`
from the Alembic library will automatically create it if it doesn't
exist already. If it's not used to actually add custom properties to, it
will crash the Alembic CLI tools (and maybe others too). This is what
the pointer back to the `ABCAbstractWriter` is used for: to get the
`.userProperties` at the last moment, when it's 100% sure at least one
custom property will be written.

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

Reviewed by: sergey, dbystedt
2020-09-14 12:49:27 +02:00
b8a25bbd8a Cleanup: remove unused function
The last usage was removed in {rB4eda60c2d82de0d7f7ded8ddf1036aea040e9c0d}.
2020-09-14 12:24:13 +02:00
61abd77648 Fix T80564: flow particle size is too limiting
Reviewers: sebbas

Differential Revision: https://developer.blender.org/D8888
2020-09-14 12:02:00 +02:00
3ce06a8011 Fix T80643: Library Override: Can't change Armature Layer enabled-ness.
Armature properties still had to be made overridable.
2020-09-14 11:33:35 +02:00
28c2032579 Fix T80705: Single Image Texture Painting Crash
Regression introduced by {D8234}; GPU textures can be requested without
an image user.
2020-09-14 11:09:58 +02:00
211d213160 API doc: Gotcha's: Add section about abusing RNA properties callbacks.
Especially with new undo/redo it is even less recommended to perform
complex operations in those callbacks, they should remain as fast and
localized as possible.

Also updated the section about undo/redo a bit.
2020-09-14 11:02:52 +02:00
ec42daf630 Fix T80457: Library Override - Custom Property to Drive Child Particles results in Crash.
RNA diffing code was not dealing properly valid NULL PointerRNA (like
the empty texture slots of a ParticleSettings e.g., which were cause of
crash in that report).

To be backported to 2.90 and 2.83.
2020-09-14 10:31:59 +02:00
f28adaef52 Fix T80747: New vgroups on unsupported object types fails silently
Raise an exceptions when adding vertex groups to object types
that don't support it.
2020-09-14 18:25:54 +10:00
14b0f20374 Fix T80694: Crash reloading scripts from the Python console
Running `bpy.ops.script.reload()` from Python was crashing
since the operator being called was it's self freed.

Change the reload operator to defer execution - as supporting
re-registration during execution is quite involved for a corner-case.
2020-09-14 17:59:26 +10:00
c207f7c22e Cleanup: use doxy sections for imbuf 2020-09-14 17:59:21 +10:00
c6210f9bac DrawManager: Resolve Assert in Image Engine
Tiled texture uses different texture structure than normal textures.
Normally we add dummy textures and use them, but I found it cleaner to
have 2 shaders and use the correct shader.
2020-09-14 09:48:45 +02:00
Manuel Castilla
9bc1d7a6de Fix T72584: Hiding a collection don't hide a child object in viewport when in Local View
Hiding a collection should hide all children objects even when we are in Local
view with one of them.

Note from reviewer: We are doing this already for local collections. So
may as well do it when hiding the collections for the entire view layer.

Developer details: In function "BKE_object_is_visible_in_viewport" object flag
BASE_VISIBLE_VIEWLAYER wasn't being checked when we were in Local view,
It's now changed so that it's checked even if we are in Local view.
And this function was called by some viewport draw functions to check if it
should draw an object or not.

Maniphest Tasks: T72584

Differential Revision: https://developer.blender.org/D7894
2020-09-14 09:25:48 +02:00
0f61b27e93 DRW: Fix wrong use of GPU_blend
Use the enum instead of a boolean. Exibit n°5512 where typecast
warning would have find the error.
2020-09-14 01:10:25 +02:00
c1c53d3ae3 Cleanup: DRWManager: Remove deprecated pass_state functions
And also enable pass names when using `--debug-gpu` option.
2020-09-14 01:10:25 +02:00
ecfbc5fb55 Fix T80603 Workbench: Inverted alpha when rendering
This was caused by a left over DRWPass->state modification
that made the subsequent samples redraw without Blending enabled.
This led to incorrect blending.

The fix is to use the new API for pass instancing.
2020-09-14 01:10:25 +02:00
ab7608af1b Apply patch D8816, from Zachary(AFWS) for collection boolean operand.
Also added code so that exact solver does the whole collection at once.
This patch allows users to use a collection (as an alternative to Object)
for the boolean modifier operand, and therefore get rid of a long modifier stack.
2020-09-13 16:57:27 -04:00
9d674708ea Fix T80589: Translations in python scripts are missing.
Python 3.8 changed handling of constant values in its AST tool.
This code should work on both officialy supported 3.7, and newer 3.8,
for now.
2020-09-13 19:50:08 +02:00
3ee2ca0d3c Fix T80023 Invisible objects or glitches with object 'in front' + 'X-ray'
Rendering only to the depth buffer seems to need a valid fragment shader
with a color output on some platform.
2020-09-13 15:53:45 +02:00
f5ccf8727f CleanUp: Code folding
Incorrect code folding in recent commit
2020-09-13 11:15:37 +02:00
1e186cea7c Fix T77584: Edit Mode crash with shape keys created on blank mesh
Entering edit-mode after creating shape keys on a blank mesh would crash.

Regression in 9b9f84b317 which prevented initializing empty
shape keys when there is no shape key offset data available.
2020-09-13 18:11:38 +10:00
e4811cf0c3 Cleanup: unused variable 2020-09-13 18:04:46 +10:00
952212ac69 Fix printing data from an evaluated depsgraph in Python
Printing an evaluated view layer would show:
  Evaluated Scene 'Scene'

- Now __repr__ uses the __str__ fallback for evaluated data,
  as done in other situations where we can't create a string that
  would evaluate to the data.
- __str__ now shows when the data is evaluated.
- __str__ always includes the memory address
  (which was previously only shown for structs without a name).
2020-09-13 15:49:55 +10:00
ca39325826 Fix T62504: Crash accessing depsgraph from evaluated view layer
Use correct owner_id types for depsgraph view_layer properties
instead of inheriting from the Depsgraph which is set to NULL.
2020-09-13 15:28:41 +10:00
b52aeaadfb Cleanup: spelling, update function name in comments 2020-09-13 15:00:52 +10:00
1509d2ba7d Cleanup: Fix whitespace changes
Introduced in rB40dcf686f04f7db8110f9c85621eb8a0bd764080
2020-09-12 16:06:24 -06:00
2e4569abbc Fix remaining GL calls/type preventing from building due to recent cleanup 2020-09-12 19:48:52 +02:00
fe5efccd8f GPUOffscreen: Push the GL state before and after binding
This avoids wrong viewport and scissor bounds with BGL commands.
2020-09-12 17:34:51 +02:00
bf3f4da947 GPU: Fix wrong state before python callbacks
This was caused by a missing state apply.

We force the GPUState to be set after the callbacks to avoid
desync between our state tracker and the real gl state.

This fixes some issues but a better general fix for all BGL would
be better.

This fix T80297 2.91 texture alpha is not transparent
2020-09-12 17:29:37 +02:00
6bc0a8424e Cleanup: GPU: Rename GPUStateManager to StateManager to follow style 2020-09-12 16:22:34 +02:00
0639f008b6 Cleanup: GPU: Remove unused GPU_debug 2020-09-12 16:22:06 +02:00
6432fa488a Cleanup: Remove GLEW dependencies outside of GL module 2020-09-12 15:51:21 +02:00
136bdb561b GPU: Add Image Load Store extension support
This wraps the functionality used to speedup EEVEE volumetrics.

This touches the rendering code of EEVEE as it should fix a mis-usage of
the GL barrier. The barrier changed type and location, removing an
unused barrier.
2020-09-12 15:29:54 +02:00
a442da62dc BLI: Fix bitscan_forward_uint64 unix implementation 2020-09-12 15:29:54 +02:00
29af082e4a Fix T70255: Setting file browser bookmark from Python crashes
Support setting bookmarks even when the file browser
isn't the active space.
2020-09-12 17:59:26 +10:00
8c17269183 Cleanup: use C style doxygen comments 2020-09-12 16:33:34 +10:00
4c24e8e992 Cleanup: missing-variable-declarations warning 2020-09-12 16:33:27 +10:00
ad5f1d0231 Fix T71605: Crash toggling dynamic topology in background mode
Support toggling without an undo stack in background mode.
2020-09-12 13:42:32 +10:00
77f6d9dbc9 Fix missing return value in fix for T80677 2020-09-12 13:42:32 +10:00
4eda60c2d8 Fix T80677: Absolute grid snapping doesn't work with constraints
Regression introduced in rB546b900194f0
2020-09-11 23:02:56 -03:00
a7dc6647ae Fix T80697: children_recursive returns edit-bones from non edit-bone
Bone.children_recursive would return edit-bones when in edit-mode
irrespective of the type of the bone.

Check the type of self instead of the existence of edit-bones.
2020-09-12 11:45:33 +10:00
b00820c04d Cleanup: Fix build warning with MSVC
MSVC warns on MEM_freeN being fed a const pointer
2020-09-11 13:38:14 -06:00
a69ddea29d Cleanup: Remove unused variables and function
Somehow these changes were lost while pulling the previous commit from
the property-search-ui-v2 branch.
2020-09-11 14:26:05 -05:00
a550937116 UI: Use operator to set property editor's pinned data-block
This commit removes the custom callback that's currently used to set the
property editor's pinned data, replacing it with an operator. This means
"pin" button doesn't have to be defined in C.

Differential Revision: https://developer.blender.org/D8376
2020-09-11 14:08:38 -05:00
e22e302837 Fix T80623: Correct Face Attributes affecting modes not listed
Some transform modes (such as Mirror) are not listed to have UV corrected
during the transformation.

It messed up the UV of all of these.
2020-09-11 15:41:15 -03:00
1e3057f177 GPUTexture: Return NULL texture if data grid is NULL too
In a recent update to the fluids modifier (rB03c2439d96e8), I introduced a flush call that sets all grids to NULL if the frame is outside of the allowed frame range. This way, the texture creation function must also check if the data grid is NULL before trying to create a texture.

Reviewed By: fclem

Differential Revision: https://developer.blender.org/D8872
2020-09-11 18:57:56 +02:00
Joseph Brandenburg
ad70d4b095 Constraints: Child-Of, set inverse matrix upon creation
Set the inverse matrix when the Child Of constraint is created. This
prevents the bone/object from jumping away when the constraint is added,
improving usability.

Reviewed by: sybren

Differential Revision: https://developer.blender.org/D8851
2020-09-11 15:19:06 +02:00
f3224bbc0f OpenSubdiv: initialize in background-mode
Previously this was initialized with OpenGL, however this uses a
more proper/complete implementation it is not only for OpenGL.
2020-09-11 20:41:51 +10:00
08002eb865 Cleanup: remove unused includes 2020-09-11 12:08:12 +02:00
d96b141666 Fix T79464: Crash adding objects without an active screen
Running add-objects operator without an active screen would crash
as CTX_data_edit_object would return NULL in this case.

This could happen when adding objects from frame-change handlers for e.g.

In the case of adding new objects there is no need for a context lookup,
pass this directly to ED_object_editmode_exit_ex.
2020-09-11 20:04:34 +10:00
c27d00cde0 Refactor: move CacheFile .blend I/O to IDTypeInfo callbacks 2020-09-11 11:57:54 +02:00
f8ef7f045c Refactor: move Sound .blend I/O to IDTypeInfo callbacks 2020-09-11 11:52:37 +02:00
55efa1795f Particles: Allow python to write hair keys
Add a function HairKey.co_object_set() which can be used to modify hair
keys positions in a way that hair strands respects the new coordinates,
without doing extra trickery with edit mode toggle. The naming comes
from existing HairKey.co_object().

The usage is a bit tricky:

- The function is to be called on the hair key from an original object.
- The arguments are to be passed from evaluated object.

Basically:

  hair_key_orig.co_object_set(object_eval, modifier_eval, particle_eval)

This is required because coordinate space conversion needs to know
evaluated state of the hair system in order to access hair space
matrix. It is a deliberate choice to not pass dependency graph and not
to do lookup of evaluated ID on every call of co_object_set() to keep
performance on a manageable levels.

One requirement is that the hair strands are to be calculated once, by,
for example, toggling particle edit mode. Without this there will be no
`particles` to access hair keys from in the original object.

Such functionality is something what got lost during 2.80 development
and is something what is needed here at the studio.

Below is the file with more complete example: convert strands from mesh
edges to actual particle system hair strands. The viewport refresh is
sometimes missing, and this does not seem to be related to this specific
change.

{F8858104}

Differential Revision: https://developer.blender.org/D8849
2020-09-11 11:49:34 +02:00
218e9e76a8 Refactor: move Simulation .blend I/O to IDTypeInfo callbacks 2020-09-11 11:46:26 +02:00
12693b807e Refactor: move Volume .blend I/O to IDTypeInfo callbacks 2020-09-11 11:39:06 +02:00
1025b5b924 Cleanup: make format 2020-09-11 11:21:53 +02:00
ff4578a6e7 Refactor: move PointCloud .blend I/O to IDTypeInfo callbacks 2020-09-11 11:20:57 +02:00
1b6dd42803 Refactor: move Hair .blend I/O to IDTypeInfo callbacks 2020-09-11 11:14:17 +02:00
12f33daad7 Refactor: move GPencil .blend I/O to IDTypeInfo callbacks 2020-09-11 11:06:15 +02:00
16fecdf994 Refactor: move Texture .blend I/O to IDTypeInfo callbacks 2020-09-11 10:35:36 +02:00
b2fc067854 Image Editor: Smooth Wire User Preferences
The old image editor has an option to enable the smooth wire drawing.
This option was stored per editor and disabled by default. This patch
connects the smooth wires in the UV/Image editor to `User Prefereces ->
Viewport -> Quality -> Smooth Wire [] Overlay`.

The old option is left in place and will be removed when the old image
editor drawing code will be removed before BCon 3.
2020-09-11 09:12:41 +02:00
4212b6528a Image Editor: Enable New Drawing
This patch reverses use draw manager for image editor the
experimental feature. Now the new drawing is enabled by default.
Inside the experimental tab in the user preferences there is now an
option to revert back to the old drawing method.

Using this option we can easilly check if all drawing features have been
migrated over. The plan is to remove the legacy drawing before BCon 3.
2020-09-11 08:35:05 +02:00
d6525e8d13 Use DrawManager for Image/UV Editor
This project moves the current UV/Image editor drawing to the draw manager.
Why would we do this:

**Performance**:

Current implementation would draw each texel per time. Multiple texels could be
drawn per pixel what would overwrite the previous result. You can notice this
when working with large textures. Repeat image drawing made this visible by
drawing for a small period of time and stop drawing the rest. Now the rendering
is fast and all repeated images are drawn.

**Alpha drawing**:

Current implementation would draw directly in display space. Giving incorrect
results when displaying alpha transparent images.
This addresses {T52680}, {T74709}, {T79518}
The image editor now can show emission only colors. See {D8234} for
examples.

**Current Limitations**

Using images that are larger than supported by your GPU are resized (eg larger
than 16000x16000 are resized to 8k). This leaves some blurring artifacts. It is
a low priority to add support back of displaying individual pixels of huge
images. There is a design task {T80113} with more detail.

**Implementation overview**
Introduced an Image Engine in the draw module. this engine is responsible for
drawing the texture in the main area of the UV/Image editor. The overlay engine
has a edit_uv overlay which is responsible to draw the UV's, shadows and
overlays specifically for the UV Image editor. The background + checker pattern
is drawn by the overlay_background.

The patch will allow us to share overlays between the 3d viewport and UV/Image
editor more easily. In most cases we just need to switch the `pos` with the `u`
attribute in the vertex shader.

The project can be activated in the user preferences as experimental features.
In a later commit this will be reversed.

Reviewed By: Clément Foucault

Differential Revision: https://developer.blender.org/D8234
2020-09-11 08:08:46 +02:00
d023c4104c Cleanup: spelling, correct comments 2020-09-11 14:57:27 +10:00
08273adebb Cleanup: const cast warning, use string replace function 2020-09-11 14:37:17 +10:00
66078594d1 GPUState: Fix missing changed program point size state
Also avoid a case where size is zero and making it impossible to change it
back.

This fix T80664 Tiny node sockets
2020-09-10 23:55:22 +02:00
8ff397b3b1 Fix T80327 UI: Glitches in UI drawing
This was caused by an uninitialized variable that was left
unchanged when calling GPU_vertformat_clear.
2020-09-10 23:32:22 +02:00
c01f8bb672 Sculpt: Enable pen pressure for Scrape/Fill Area Radius
This should improve the issue with Scrape accumulation in concave
surfaces. When the strength of the brush is higher, the area radius is
also bigger, so the scrape plane is more stable preventing it from
accumulating displacement in the same area.
The Scrape/Fill default presets are also updated to include this
functionality.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D8821
2020-09-10 22:07:43 +02:00
2ea2ec023d Fix particle "Mass" option not showing enough precision (appears broken)
When using the left and right arrows of the number button, the button
would seem to do nothing. That is because it modified a value smaller
than what is displayed. Show more precision so the button doesn't appear
broken.
2020-09-10 20:19:03 +02:00
3d53fa581c Fix particle "Loop Count" number button left/right arrows doing nothing
Was using a step size of 0.1 for an integer. Got caught by sanity assert
in UI code.
2020-09-10 20:19:03 +02:00
c25ac806ac Cleanup: Fix bad spelling in previous commit.
Thanks for @deadpin for noticing!
2020-09-10 12:13:51 -06:00
256b59b76f Fix T80191: GPencil - Improve Mesh conversion
There were some problems when converted several objects at the same time, especially with the material conversion. The problems were more visible when bake an animation with several objects at the same time.

* Now the layer name include the object name.
* Reorganize how the materials are generated including object name.
* Fix color not converted to sRGB.
* Avoid triangles when generate the stroke. This fix a draw manager issue and also add more geometry to use later.
* Code cleanup.
2020-09-10 20:12:42 +02:00
Tyler Alden Gubala
07d7028dd0 CMake: various fixes for building Python module
* Don't link against Mesa OpenGL software emulation libraries from the
  lib folder, they are not intended to be used for building, only install.
* Don't use static OpenMP library by default, it's usually not built to
  work in shared libraries.
* Disable jemalloc on all platforms, the reason it fails is not specific
  to Linux.

Differential Revision: https://developer.blender.org/D8827
2020-09-10 19:40:54 +02:00
fd5d014b62 Fix build error after clog color printing changes 2020-09-10 19:40:54 +02:00
9bd10b1c92 CLog: Support colorized logging on windows
When using Windows Terminal the same control codes Linux
uses to colorize the text can be used. WT can be detected
by looking at the WT_SESSION environment variable.

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

Reviewed by: campbellbarton
2020-09-10 11:31:09 -06:00
359acad5e4 Cleanup: CLog fix bad use_color default
`use_color` was defaulted to 'on' and only turned off when it was
decided the terminal didn't support this. This was the wrong
way to go about things, since that test only ran for Linux/Mac other
operating systems would get color formatting regardless if they
supported it.

The new default is `off` until the platform specific code inside
`CLG_ctx_output_set` turns it on after running some sanity checks.

This fix was part of the review of D8848 but deserved its on commit

Reviewed By: campbellbarton
2020-09-10 11:27:41 -06:00
4c3ad047e7 Fix T79754: Boundary Brush crashing with symmetry enabled
When creating the boundaries for the symmetry passess, it could happen
that a symmetrical vertex is not found inside the radius of the brush.
In that case, the function to initialize a new boundary was called with
index -1 (BOUNDARY_VERTEX_NONE), so this function should also check
that the initial vertex that is going to be used to find the boundary is
a valid index.

Reviewed By: sergey

Maniphest Tasks: T79754

Differential Revision: https://developer.blender.org/D8860
2020-09-10 18:47:13 +02:00
51befa4108 DNA: fix asan warning when casting types
Reviewers: brecht

Differential Revision: https://developer.blender.org/D8865
2020-09-10 18:40:00 +02:00
5af75e2333 Cleanup: Update doc string for BLI_getenv
The reason for this functions existence was poorly documented
2020-09-10 10:18:32 -06:00
11df9cb9fb Refactor: move Key .blend I/O to IDTypeInfo callbacks 2020-09-10 18:01:55 +02:00
b0741e1dcb Outliner: Use right click target element for context menu
When opening the outliner context menu with multiple data types
selected, the menu did not show operators related to the target of the
cursor. For example, if a modifier and object are selected, a right
click on the modifier does not show the modifier options, rather it
shows the object context menu.

Now the data type of the right-click element is used to determine the
context menu to draw. For this to work properly the active element is
now set on right click.

Part of T77408

Manifest Task: https://developer.blender.org/T77770

Differential Revision: https://developer.blender.org/D8647
2020-09-10 09:53:49 -06:00
e628e8821e Refactor: move LightProbe .blend I/O to IDTypeInfo callbacks 2020-09-10 17:47:04 +02:00
133b7c34dd Refactor: move Armature .blend I/O to IDTypeInfo callbacks 2020-09-10 17:41:04 +02:00
0c7e77d416 Refactor: move Speaker .blend I/O to IDTypeInfo callbacks 2020-09-10 17:31:18 +02:00
be5cbbabce Refactor: move Mask .blend I/O to IDTypeInfo callbacks 2020-09-10 17:22:35 +02:00
0a93460361 Cleanup: remove else-after-return
This causes a clang-tidy error.
2020-09-10 17:21:44 +02:00
60e102c0a0 Refactor: move World .blend I/O to IDTypeInfo callbacks 2020-09-10 17:06:49 +02:00
095a53bd88 Cleanup: Remove outliner edit mode context menu entries
The outliner context menu has options to enter and exit edit mode, but
they only show in edit mode, and they don't work. This removes the
broken entries and related code.

Part of T77408

Differential Revision: https://developer.blender.org/D8641
2020-09-10 09:01:37 -06:00
2110af20f5 Outliner: Move mode toggling to left column
Add a column of icons in the left gutter of the outliner for controlling
the interaction modes of objects. When an object is in a mode other than
object mode, the mode icon will draw to the left of that object. Any
other objects that are valid to be added or swapped into the mode are
drawn with a dot to the left of the object.

Clicking the dot to the left of an object will swap that object with the
current active object in the interaction mode. For edit and pose modes,
ctrl clicking the dot will add that object to the current mode.

Clicking the mode icon next to the active object removes it and all
other objects from the current mode.

The behavior is nearly identical to the previous edit/pose mode toggling
by selecting the mesh and armature datablocks, with additional support
for all interaction modes.

Currently two undo steps are pushed to prevent an assert.

Part of T77408

Manifest Task: https://developer.blender.org/T68498

Differential Revision: https://developer.blender.org/D8641
2020-09-10 09:01:27 -06:00
0649e63716 Refactor: move Camera .blend I/O to IDTypeInfo callbacks 2020-09-10 16:58:23 +02:00
ae200cb2e4 GPencil: Fix unreported Eraser Point problem for one point selected
The Eraser Point mode was erasing too much points.

This eraser existed before the new Soft erasers were created and now it was working wrongly. The eraser point mode must remove the points below the eraser cursor at the first contact. For more soft erasers, the new Soft modes can be used.
2020-09-10 16:51:06 +02:00
8a65afac1e Refactor: move Curve .blend I/O to IDTypeInfo callbacks 2020-09-10 16:47:12 +02:00
a82bb8f5f0 clang-format 2020-09-10 16:37:52 +02:00
89b570570a Refactor: move MetaBall .blend I/O to IDTypeInfo callbacks 2020-09-10 16:37:11 +02:00
ea1094bdb0 Refactor: move Material .blend I/O to IDTypeInfo callbacks 2020-09-10 16:23:53 +02:00
94c533ac35 Refactor: move Light .blend I/O to IDTypeInfo callbacks 2020-09-10 16:13:18 +02:00
ede094f9b2 Refactor: move Image .blend I/O to IDTypeInfo callbacks 2020-09-10 15:59:08 +02:00
405a5d3bd7 GPUBatch: Do not unbind shader after drawing.
This allows subsequent redraw to work just like before.
However a better safeguard system against setting the uniforms in the
wrong shader would be nice to have.
2020-09-10 15:55:14 +02:00
48a99fab2b GPUImmediate: Fix wrong resize of immBatchAtMost 2020-09-10 15:55:14 +02:00
72f63ba7e9 GPUState: Fix Point Size issues
The point size was not updated in the right branch and setting the point
size via GPU_point_size was effectively disabling its use.
2020-09-10 15:55:14 +02:00
7f4799a189 Refactor: move Brush .blend I/O to IDTypeInfo callbacks 2020-09-10 15:50:50 +02:00
8e4cc07547 Refactor: move PaintCurve/Palette .blend I/O to IDTypeInfo callbacks 2020-09-10 15:40:32 +02:00
3cafaf0fa8 Fix possible use-after-free for number slider buttons
Mistake in e6f0b60c2e.
2020-09-10 15:30:14 +02:00
eecd3705d7 Refactor: move MovieClip .blend I/O to IDTypeInfo callbacks 2020-09-10 14:53:29 +02:00
0f0e7239f0 Fix T80651: Material tab disappears
Always return true if the object can have materials. Even if there are
not currently any materials assigned to the object.
2020-09-10 14:51:18 +02:00
3679f899fb Refactor: move VFont .blend I/O to IDTypeInfo callbacks 2020-09-10 14:42:54 +02:00
fbc12e6cc5 Cleanup: extract functions for PackedFile .blend I/O 2020-09-10 14:35:51 +02:00
Aristotelis Dossas
4a82d792b0 Fix T79737: ERROR ACCESS VIOLATION when switching to eevee rendered view
This prevents Blender from crashing when switching
to rendered view and the grid_data is NULL in the
lightcache (due to possible corruption), by switching
to the fallback lightcache. The fix extends the solution
for possible corruption in the cube_data as well.

Fix T79737

Reviewed By: fclem
Differential Revision: https://developer.blender.org/D8835
2020-09-10 14:33:08 +02:00
8d59f060ca GL: Wrap extension support inside GLContext
This makes it possible to disable all the extensions when forcing
workarounds.

Also it will allow future options to selectively disable each extension
to know which one is buggy.
2020-09-10 14:19:00 +02:00
9d5977f5e1 GL: Add fallback debug layer
This is to improve debugging on older hardware that may not support
4.3 debug capabilities (like Macs).

This avoids sprinkling glGetErrors manually. This might still be needed
to find the root cause since not all functions are covered.

This overrides the functions pointers that GLEW have already init.

This is only enabled if using --debug-gpu option and the debug extension
are not available.

This also cleanup the usage of GLContext::debug_layer_support and use
wrapper to set object labels.
2020-09-10 14:19:00 +02:00
b8bcbb2cf2 Refactor: move Text .blend I/O to IDTypeInfo callbacks 2020-09-10 13:57:08 +02:00
fcf6177b0d Refactor: move LineStyle .blend I/O to IDTypeInfo callbacks 2020-09-10 13:50:03 +02:00
d11651fff9 Refactor: move bNodeTree .blend I/O to IDTypeInfo callbacks 2020-09-10 13:33:29 +02:00
e347b6b86b Fix T80372: Mantaflow Noise Not working with Smoke/Smoke and Fire
Modular caches for noise, particles and meshes require that additional data is baked (i.e. is resumable option). With this commit users will be explicitly asked to enable this option before being able to bake noise, particles or meshes.
2020-09-10 12:46:18 +02:00
25faee8d07 Cleanup: IO, inline namespace declarations
Replace nested `namespace blender { namespace io {`
with `namespace blender::io {`.

No functional changes.
2020-09-10 11:42:07 +02:00
b77c0edce1 Cleanup: USD, inline namespace declarations
Replace nested `namespace blender { namespace io { namespace usd {`
with `namespace blender::io::usd {`.

No functional changes.
2020-09-10 11:42:07 +02:00
549a00de60 Cleanup: Alembic, inline namespace declarations
Replace nested `namespace blender { namespace io { namespace alembic {`
with `namespace blender::io::alembic {`.

No functional changes.
2020-09-10 11:42:07 +02:00
b443f9b54c Refactor: move keyingset .blend I/O to blenkernel
Ref T76372
2020-09-10 11:17:51 +02:00
60b2bb3a1c Fix T79626: 2.91 Mantaflow crash when adaptive domain + noise are enabled
Crash was caused by an incorect domain size of the noise solver and an index out of bounds.
2020-09-10 11:09:59 +02:00
2cd41f49cf Refactor: move Action .blend I/O to IDTypeInfo callbacks 2020-09-10 11:02:42 +02:00
538817d9a8 Refactor: move preview image .blend I/O to blenkernel
Ref T76372
2020-09-10 10:33:21 +02:00
a0f41ba8a2 Fix T80516: Hook modifier crashes without vertex group data
Checks for existence of a vertex group must check the array isn't NULL.

Regression in c1386795a9.
2020-09-10 17:58:05 +10:00
92a1b3f750 Fix T80650: Malformed bl_info header causes empty add-on listing 2020-09-10 16:39:52 +10:00
976b07056d Fix T71012: Cycles baking crash with locked-UI & background-mode 2020-09-10 16:20:03 +10:00
d2d3ab05b3 UI: Use split layout for world mist settings
Differential Revision: https://developer.blender.org/D7548
2020-09-09 21:15:05 -04:00
af843be301 UI: Outliner: Change Sequence Display Mode
This commit renames the Sequence Display Mode to Video Sequencer. THis 
matches the editor name in the editor list.

This commit also adjusts the tooltip because the data show in this 
dispay mode is not strickly speaking "data-blocks".

Ref D7716
2020-09-09 20:00:14 -04:00
4e3cb95638 UI: Add Missing UV Unwrap Operators to UV Editor
This commit also changes the U shortcut to open the unwrap menu instead 
of the Unwrap operator. The unwrap operator can now be accessed by 
pressing U twice.

Note, these operators use the 3D Viewports selection and not the UV 
Editor selection. In the future the operators should unwrap based on the 
selection within that editor.

Fixes T80600

Differential Revision: https://developer.blender.org/D8834
2020-09-09 19:50:31 -04:00
5badf16531 Cleanup: spelling 2020-09-10 09:45:25 +10:00
0721fbb6e1 Fix for failing constraints test
Caused by own rB6dc7266cf1f4.

When overriding context for constraint operators (such as in constraint
tests), it could happen that context "active_pose_bone" is set, but
"pose_bone" isnt. Now check for both in ED_object_pose_constraint_list.
2020-09-09 22:10:15 +02:00
d61d210786 Fluid: Fix for GSoC display controls project
Load all grids when the grid display option is turned on. Otherwise, the grid from the viewport display options might not have been loaded from the cache.
2020-09-09 22:02:40 +02:00
92fc32e48d UI: Fix Icon drawing on MacOS
It seems that using a vertex shader using both `gl_InstanceID` and
 `gl_VertexID` is causing some issues on MacOS + Intel Iris.

Regression introduced by rB052538edc1fba109d3427471047611888ed13bea
2020-09-09 19:32:10 +02:00
c6e4d922ba Cleanup: Remove warning re: const qualifier discarded
Warning introduced on a5db981b0e.
2020-09-09 19:19:07 +02:00
63916f5941 Cleanup: reduce variable scope 2020-09-09 18:41:07 +02:00
0cff2c944f Fix T80590: Popups clipped by status-bar and top-bar
The drawing of popus should be done with the window's default viewport
and scissor. Previous functions may change these, so they should be
explicitly reset.
2020-09-09 17:56:43 +02:00
370d6e5025 Geometry: add Attributes panel for PointCloud and Hair
There is a list of attributes, along with operators to add and remove
attributes. For adding, there are a few standard attributes that can be
added quickly, as well as a popup to create a custom attribute.

Ref T76659

Differential Revision: https://developer.blender.org/D8636
2020-09-09 17:01:17 +02:00
a1397a3cc6 Geometry: use generic attributes for Hair and Point Clouds
Instead of custom data layer with special types, using general Vector and Float
attributes.

Ref T76659

Differential Revision: https://developer.blender.org/D8635
2020-09-09 17:01:17 +02:00
565510bd7f Geometry: add .attributes in the Python API for Mesh, Hair and Point Cloud
This puts all generic float/int/vector/color/string geometry attributes in a new
.attributes property. For meshes it provides a more general API for existing
attributes, for point clouds attributes will be used as an essential part of
particle nodes.

This patch was implemented by @lichtwerk, with further changes by me. It's
still a work in progress, but posting here to show what is going on and for
early feedback.

Ref T76659

Differential Revision: https://developer.blender.org/D8200
2020-09-09 17:01:17 +02:00
a5db981b0e Fix T76346: Moving objects in outliner doesn't update local collections
The fix involves going over ALL the possible combinations of viewlayers
and viewports and re-sync.
I tested this with multiple windows, multiple scenes and multiple
viewlayers.

Since (for now?) the operation of syncing the local layer collections is
not too expensive, this is not so bad. In theory we could improve this
by checking if the collection the object was moved to and from is in the
scene before iterating over it. I don't think it is worthy though.

Thanks Arun Parolikkal for the initial attempt on D8342.
Final patch reviewed by Brecht Van Lommel.
2020-09-09 16:58:06 +02:00
f8aad78830 Cleanup: reduce variable scopes 2020-09-09 16:36:57 +02:00
42e3eb8854 Fix T79038: Blender freezes on vertex paint on linked mesh data
This change promotes the work-a-round to the current solution.
There are options to solve this better, but needs more design.
2020-09-09 16:34:53 +02:00
0432740b52 Add nullptr checks in the depsgraph physics relation builder
Without these check ASAN complains about null pointer member access.

Reviewed By: Sergey

Differential Revision: http://developer.blender.org/D8847
2020-09-09 16:19:52 +02:00
fe8509af61 Fix uvsculpt null pointer reference in paint.c
ASAN reported null pointer access when going into edit mode on the
default cube.

Check in uvculpt has been initialized before trying to use it.
2020-09-09 16:19:52 +02:00
8bead3df2f Fix material null pointer reference in buttons_context.c
ASAN reported null pointer access when converting a mesh to curves.
Check if the material is a null pointer before trying to use it.
2020-09-09 16:19:52 +02:00
5c0eda51ff CMake: Force experimental features to be on/off based on release cycle
This makes it error-proof to disable/enable experimental features
during the release cycles. Since it is handled by CMake it should always
work reliably now (not depending on someone turning this on and off).

Reviewed by Sergey Sharybin.
2020-09-09 16:15:27 +02:00
ddf4f28968 Cleanup: reduce variable scope 2020-09-09 15:43:27 +02:00
842f52d418 Cleanup: Rename public "bUnit" functions
This commit renames the functions in "BKE_unit.h` to be consistent
with the naming in the rest of blenkernel.

bUnit_AsString -> BKE_unit_value_as_string_adaptive
bUnit_AsString2 -> BKE_unit_value_as_string
bUnit_ReplaceString -> BKE_unit_replace_string
bUnit_ApplyPreferredUnit -> BKE_unit_apply_preferred_unit
bUnit_ToUnitAltName -> BKE_unit_name_to_alt
bUnit_ClosestScalar -> BKE_unit_closest_scalar
bUnit_BaseScalar -> BKE_unit_base_scalar
bUnit_IsValid -> BKE_unit_is_valid
bUnit_GetSystem -> BKE_unit_system_get
bUnit_GetBaseUnit -> BKE_unit_base_get
bUnit_GetBaseUnitOfType -> BKE_unit_base_of_type_get
bUnit_GetName -> BKE_unit_name_get
bUnit_GetNameDisplay -> BKE_unit_display_name_get
bUnit_GetIdentifier -> BKE_unit_identifier_get
bUnit_GetScaler -> BKE_unit_scalar_get
bUnit_IsSuppressed -> BKE_unit_is_suppressed

Differential Revision: https://developer.blender.org/D8828
2020-09-09 08:41:15 -05:00
6dc7266cf1 Fix T80464: Crash deleting bone constraints when the armature layer is
not active

Caused by {rB608d9b5aa1f1}

Prior to rB608d9b5aa1f1, the constraint was gotten using **context**
[CTX_data_pointer_get_type(C, "constraint", &RNA_Constraint) -- which is
valid for bones on hidden layers].
After rB608d9b5aa1f1, the constraint is found (or isnt) using
`edit_constraint_property_get` [this is **not** valid for bones on
hidden layers because internally `BKE_pose_channel_active` checks if the
bone is on an active layer].

Some observations:
- Every operator using `edit_constraint_property_get` doesnt work for
bones on inactive layers [delete, moveup, movedown, move to index (drag
n drop nowadays)]
-- moveup, movedown, move to index check if they could find a constraint
beforehand though (dont crash)
-- delete crashes (doesnt check if a constraint could actually be found)
- Every operator using `edit_constraint_property_get` for constraint
data doesnt work for bones on inactive layers [stretchto_reset,
limitdistance_reset, childof_set_inverse, ...]
-- these all check if they could find a constraint beforehand though
(dont crash)

This is because the poll function is using **context** to get the
constraint, the operators themselves use
**edit_constraint_property_get** which leads to inconsistent/unexpected
results.

Possible solutions were:
- [1] let the delete operator just work with the context constraint
again (like prior to rB608d9b5aa1f1) -- allows for deleting constraints
on bones in inactive layers
- [2] check if we could get a constraint -- prevents the crash, but does
**not** allow for deleting constraints on bones in inactive layers
- [3] make the poll `edit_constraint_poll_generic` be as strict as the
operators -- dont use **context** to get the constraint, but something
like **edit_constraint_property_get**
- [4] make the operators be more graceful and let them act on bones on
hidden layers -- let **edit_constraint_property_get** actually use the
same **context**

This patch implements [4], so poll an doperators are now in sync.
- prevents reported crash
- also enables operators for bone constraints on hidden layers
- also enables drag and drop reordering of constraints on hidden layers

This might be a candidate for 2.90.1? (if it is, take care to include
prior "Refactor getting constraints" refactoring commit)

Note: Adding constraints also doesnt work for bones on inactive layers
[that was the case in 2.79 as well -- it is also using
`BKE_pose_channel_active`]

Maniphest Tasks: T80464

Differential Revision: https://developer.blender.org/D8805
2020-09-09 14:12:55 +02:00
9dcae4eb17 Refactor getting constraints
This is the refactoring part of D8805 (should be no functional changes).

- exposes pose-related part of former 'get_constraints()' from
interface_templates.c to new ED_object_pose_constraint_list
- rename ED_object_constraint_list_from_context -->
ED_object_constraint_active_list

Also clarify comments on both of these.

ref T80464
ref https://developer.blender.org/D8805
2020-09-09 14:12:55 +02:00
98eb89be5d UI: improve search results by using fuzzy and prefix matching
Blender does string based searching in many different places.
This patch updates four of these places to use the new string
search api in `BLI_string_search.h`.

In the future we probably want to update the other searches as well.

Reviewers: Severin, pablovazquez

Differential Revision: https://developer.blender.org/D8825
2020-09-09 13:44:45 +02:00
45bd8fdc2b BLI: new string search api that supports fuzzy and prefix matching
This adds a generic string search library in `BLI_string_search.h`.
The library has a simple to use C api that allows it's users to
filter and sort a set of possible search results based on some
query string.

Reviewers: Severin

Differential Revision: https://developer.blender.org/D8825
2020-09-09 13:44:45 +02:00
4ccd5bf5c6 Fix T80626: Crash adding custom-data layers after reloading the file
Regression in a48d78ce07 which caused the meshes CustomData
to be written before it's layer values were updated for writing.
2020-09-09 20:38:33 +10:00
dbec51109b Fix T80613: Assert in UI_but_number_precision_set
-1 is a valid value to pass as RNA float precision. We let the UI code
figure out an appropriate precision then. So don't fail the assert if
-1 is passed.
2020-09-09 12:18:37 +02:00
d51c8f78ff Fix T80596: Convert to Curve from Mesh crashes Blender
The point cache code needs a non NULL rbw pointer.

This could have been avoided if there was a sanity check in the convert
function, so added a check there as well.
2020-09-09 11:48:52 +02:00
377a1e3d7b Cleanup: use bool instead of int 2020-09-09 11:10:38 +02:00
916497627c Cleanup: use bool instead of int 2020-09-09 10:44:46 +02:00
095142eae6 Cleanup: use bool instead of int 2020-09-09 10:37:42 +02:00
0b311eeca5 Correct error in last commit 2020-09-09 15:37:36 +10:00
092bea06da Cleanup: access context argument instead of bpy.context 2020-09-09 15:26:46 +10:00
3e8b1550dc Fix "Select" option being ignored when linking collection instances
Also check 'BASE_SELECTABLE' before selecting
which was only done for collections.
2020-09-09 14:51:28 +10:00
23f1dea440 Cleanup: spelling 2020-09-09 13:30:05 +10:00
1f75be8a40 Fix T80604: BLI_polyfill_calc exceeds stack size allocating points
On systems with 512kb stack this happened at around 13k points.

This happened at times with grease-pencil, although callers that
frequently use complex polygons should be using BLI_polyfill_calc_arena.
2020-09-09 12:58:01 +10:00
b8840c105a UI: Rename "VCol" to "Vertex Colors" 2020-09-08 20:05:38 -04:00
f7fab77f85 Cleanup: GPU: Replace multiple checks by GLContext::debug_layer_support 2020-09-09 00:28:19 +02:00
25380802d7 Cleanup: Use bool instead of int 2020-09-08 13:55:10 -05:00
0006f78cb6 Revert "BKE: Fix compiling with clang-tidy and readability-non-const-parameter"
This reverts commit 637a5c964a.

I commited the previous commit because I wasn't building with openvdb.

Compiling with openvdb fix the clang-tidy errror.
2020-09-08 20:18:10 +02:00
9eba40b848 Revert "Revert "RNA Manual Mapping: Update Mappings""
This reverts commit de5930333b.
2020-09-08 20:15:59 +02:00
de5930333b Revert "RNA Manual Mapping: Update Mappings"
This reverts commit f14d24729f.

I commited the previous commit because I wasn't building with openvdb.

Compiling with openvdb fix the clang-tidy errror.
2020-09-08 19:57:08 +02:00
dd04cba943 GLSamplers: Add debug object label
This makes it easier to see what each sampler is supposed to be.
2020-09-08 19:55:53 +02:00
f27d5e4f76 Fix T79538 Grease Pencil: Fill texture doesn't tile anymore
This was caused by rBe749643793809248dfc6ffd078be04aec3eeab82 which
removed the texture repeat from Image texture.
2020-09-08 19:54:30 +02:00
637a5c964a BKE: Fix compiling with clang-tidy and readability-non-const-parameter 2020-09-08 18:29:00 +02:00
f14d24729f RNA Manual Mapping: Update Mappings 2020-09-08 11:58:09 -04:00
e9e208d995 UI: Tooltip grammar fix 2020-09-08 11:58:09 -04:00
637699e78a UI: 3D View: Move Live Unwrap to toolbar
The menus should be for operators, tool settings belong in the toolbar
2020-09-08 11:58:09 -04:00
7ca42545d1 Hide tools with missing icons under experimental
This removes from the UI all tools with missing icons and hides them
under a "Tools with missing icons" experimental option.

We agree on not making available by default tools in master without icons.
Having this experimental flag will allow to commit new tools as soon as the
technical design and implementation is finished so development can
continue, without adding broken icons to the UI.

Reviewed By: Severin

Differential Revision: https://developer.blender.org/D8831
2020-09-08 17:43:56 +02:00
4e104ce5b0 Cleanup: reduce variable scopes in node_draw.c 2020-09-08 17:20:16 +02:00
b3759cc0d6 Alembic Export: support instanced object data
Add support for object data instancing. This is used when the objects
are instances, for example when duplicated by a particle system, or
instanced by the duplication system (collection-duplicating empties,
vertex/face duplis, etc.)

Since Alembic already deduplicates data, this doesn't make the resulting
Alembic files any smaller. They will be faster to write, though, when
there is a lot of instanced geometry, as the deduplication system won't
have to do any comparisons.

This instancing support is still limited, in the sense that only object
data is instanced and all transforms are still written explicitly. A
future improvement could be to support instancing entire collection
hierarchies.

Blender's Alembic importer has no understanding of these Alembic
instances yet, and will thus happily duplicate the data on import.

The USD Alembic plugin seems to have problems understanding the
instancing. There might also be other software with similar issues.
Because of this, instancing can be turned off in the exporter (it's on
by default).
2020-09-08 16:41:59 +02:00
8f4f9275ce UI: Aesthetic tweaks to Select All by Type operator
* Match menu items with Add Menu (order and naming e.g. Font -> Text)
* Use Icons
* Remove ellipsis from the name (policy is to use `...` only when triggering a window/popup)

No functional changes.

Thanks @HooglyBoogly for the help!
2020-09-08 16:30:29 +02:00
9421d66a1b Cleanup: Alembic export, split ABCHierarchyIterator::get_alembic_parent()
Split `ABCHierarchyIterator::get_alembic_parent()` into two functions:
- For a given export path, find the Alembic object
- Ensure that that object is usable as parent object (Alembic uses a
  specific 'top' object as parent to indicate "no parent").

The new function is `public` as it will be used in an upcoming feature,
and is required to be public then.

No functional changes.
2020-09-08 16:19:54 +02:00
c0b4a93fae Cleanup: Alembic export, split function into two
Split the `ABCHierarchyIterator::create_data_writer()` function into two
functions. This is to prepare for the creation of writers not just by
object type, but also by goal, for example writers that reference other
Alembic data instead of writing their own (i.e. instancing).

No functional changes.
2020-09-08 16:19:54 +02:00
Clément
ab758c30d2 GLBackend: Fix gl error inside the mip rendering workaround detection
This was caused by an incorrect mipmap size.
Also add debug checks for good mesure.
2020-09-08 16:05:36 +02:00
Clément
0fb9f22d8b GLContext: Fix clang warning about using override 2020-09-08 16:04:31 +02:00
Clément
acdea4e98b GLFrameBuffer: Fix mass renaming issue
The context might be partialy freed, so use gpu::Context instead of
GLcontext.
2020-09-08 15:49:16 +02:00
2af70acc3a Cleanup: reduce variable scopes in drawnode.c 2020-09-08 15:20:07 +02:00
ab6f59ff3b GPU: Extract GPU Base Test case
The draw manager test case initialized ghost, gpu and draw manager. This
change splits the base test case to GPU specific and draw manager
specific test case.

The GPU test base test case will be used for low level GPU tests.
2020-09-08 13:23:10 +02:00
0d68f55789 DrawManager: Fixed memory leak in test cases
Memory leak is introduced as test cases reinitializes the GPU stack.
Added a call to GPU_backend_exit to fix this.

In GPU_backend_exit the GPU backend was destroyed but the pointer wasn't
reset for reuse. This patch also clears the pointer to be reused.
2020-09-08 13:23:04 +02:00
489aeabb9e DrawManager: Move tests in namespace
Using blender::draw::tests as namespaces.
2020-09-08 13:23:04 +02:00
5becbf9719 Cleanup: Refactor USD Exporter, make parameter const
Follow-up of 63dc72c352, make parameter `const`.

No functional changes.
2020-09-08 11:45:31 +02:00
63dc72c352 Cleanup: USD export, refactor mesh instancing
Extract the mesh instancing code from the mesh writing function into a
generic 'mark as instance' function on the abstract USD writer. This will
help in supporting non-mesh instances.

No functional changes.
2020-09-08 11:33:35 +02:00
b8d4a2aff8 Cleanup: Refactor ED_object_parent_set
Refactor `ED_object_parent_set`:
- Mark parameters `ob` and `par` as `const` so that it's clear the
  function doesn't assign any other value to them.
- Rename `pararm` to `is_armature_parent`; I mis-read it as `param` all
  the time, and it was very confusing.
- Replace repeated `if-else` statements with `switch` statements.
- Reorder preconditions to have some simple checks first.
- Flip condition on a huge `if`-statement to return early and unindent
  the remainder of the function.

This function still requires splitting up into smaller functions, but at
least this is a step forward.

No functional changes.
2020-09-08 11:33:34 +02:00
c2419cdc5e Fix T80238: Crash adding properties to material node-trees
The localized node-tree was freeing the materials ID properties twice.

This matches how animation data behaves, setting to NULL after freeing.
2020-09-08 18:09:22 +10:00
1896c2c0e8 Docs: comment values for DispList.type 2020-09-08 17:16:35 +10:00
59653a450e Cleanup: rename group to collection for internal instancing flag
Also update old comment.
2020-09-08 16:49:17 +10:00
d20b08281e Cleanup: naming for library link enum
Use 'e' prefix, update comments.
2020-09-08 16:41:55 +10:00
748deced1c Link/Append: support instancing object data
This patch supports instantiating object data on append/link,
reported as a bug T58304.

This is an option, available when linking/appending,
similar to the existing "Instance Collections" option.

Reviewed by @sybren

Ref D8792
2020-09-08 16:14:39 +10:00
e467c54d58 Refactor: move library linking arguments into a parameter struct
Move arguments to BLO_library_link_{begin/named_part/end} into
a single parameter struct, to ensure arguments always match.

This allows is to skip tagging ID's LIB_TAG_DOIT when it's not needed,
previously it was always cleared just in case it was needed.

This also makes it possible to remove BLO_library_link_named_part_ex
which was only used when tagging was needed.
2020-09-08 16:14:33 +10:00
48690d967a GPUContext: Move GPUContext to gpu::Context for more consistency
This makes the GPUContext follow the same naming convention as the rest
of the module.

Also add a static getter for extra bonus style (no need for casts):
- Context::get()
- GLContext::get()
2020-09-08 04:15:50 +02:00
d2e9de93b8 GPU: Cleanup implementation casts
- Use the syntactic wrap/unwrap method to make code more readable.
- Update comment about hidden struct behind opaque types.
- Cleanup GPUDrawList type.
2020-09-08 04:15:50 +02:00
33b25b6a9e GPUTexture: Remove unused functions and avoid GPU_texture_opengl_bindcode
This is a cleanup.
2020-09-08 04:15:50 +02:00
a30ad3634d Cleanup: DRW: Replace 0 by NULL in GPU_context_create calls
This was left from a previous refactor.
2020-09-08 04:15:50 +02:00
ccc512cc61 GPUImmediate: Make activation / deactivation implicit
This avoids unecessary complexity.

Also makes the GPUImmediate threadsafe by using a threadlocal imm variable.
2020-09-08 04:15:50 +02:00
ca8ffc523e fix flush 2020-09-08 04:15:50 +02:00
28ea459a61 GPUState: Encapsulate glPixelStorei inside the GLStateManager
Part of the Vulkan task T68990

Isolate the last remaining gl functions.
2020-09-08 04:15:50 +02:00
77f60a0931 GPUState: Encapsulate glFlush and glFinish inside the GLContext
Part of the Vulkan task T68990

Isolate the few remaining gl functions.
2020-09-08 04:15:50 +02:00
f23400490e Cleanup: doxygen syntax for idtype.c 2020-09-08 10:41:12 +10:00
80d134b6d1 Cleanup: remove unused source file
FX_shader_light.c was added by accident in 66da2f537a.
2020-09-08 09:30:47 +10:00
38b1450848 Cleanup: tabs to spaces 2020-09-08 09:26:35 +10:00
bedc68a838 Cleanup: consistent syntax for doxygen parameters
Also use back-slash instead of '@'.
2020-09-08 09:18:59 +10:00
5c2ac8520e GPUQuery: GL Backend isolation
This is part of the Vulkan task T68990.

This introduce a new GLQueryPool for managing queries in an
implementation agnostic manner.

This modify the GPU selection query to use this new object.
This also make use of blender::Vector for better code quality.

No real functionnal change.
2020-09-08 00:02:04 +02:00
d4fd363d05 GPU: Select Pick: Remove last GL call
This is part of the Vulkan task T68990
This is just a cleanup.
2020-09-08 00:02:04 +02:00
b7a28b315a GPUFramebuffer: Make GPU_framebuffer_read_depth more flexible
This is to make use of it in selection code.
2020-09-08 00:02:04 +02:00
97c6c4e478 Decimate Modifier: Restore vertex group factor property in UI
This property was inadvertently removed from the modifier's panel and
it wasn't caught in time for the release of 2.90. Thanks to the user
"VermossomreV" for bringing this to my attention.

Differential Revision: https://developer.blender.org/D8790
2020-09-07 15:34:32 -05:00
36aeb0ec1e UI: Add temperature units
Based on the original patch by Vaishnav S (@padthai), this adds
support for temperature units. Initially supported units are Celsius,
Kelvin, and Fahrenheit.

The units aren't used anywhere with this commit. Those changes should
happen in separate patches by adding PROP_TEMPERATURE to RNA property
definitions. But it should be ensured that the various solvers and
simulations actually properly use real units.

The complexity of some of the changes comes from the fact that these
units have offsets from each other as well as coefficients. This also
makes the implementation in the current unit system troublesome.
For example, entering 0C evaluates correctly to 273K, but 0C + 0C
doubles that result, because each unit value is evaluated separately.
This is quite hard to solve in the general case with Blender's current
unit system, though, so it is not handled in this commit.

Differential Revision: https://developer.blender.org/D4401
2020-09-07 14:59:07 -05:00
d4cca7b7b0 UI: Changes to timeline playback popover
The current playback popover has some issues:
 - Using labels instead of headers is inconsistent with
   the rest of the interface
 - Incomplete context and description for some properties
 - Ugly large spacing

This commit fixes these problems by using headers.

Differential Revision: https://developer.blender.org/D8434
2020-09-07 14:22:29 -05:00
Ankit
5eb5978043 Generate Xcode scheme files during configuration.
Every time CMake is re-run, Xcode shows a popup asking if
user wants to manage schemes automatically or manually.
Building Blender wiki page recommends managing schemes automatically.

This change sets the default behavior to "automatically" and generates
the .xcscheme files while CMake is running, instead of hogging Xcode
later on. With tests enabled, the number of schemes is 203.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D8820
2020-09-08 00:26:27 +05:30
Ankit
6aaa6c96a1 Tests: set build directory using build type
Similar to {rB0a5f7061369d53b4eac55362ad2}
but also for Xcode and Ninja multi-config.

This silences 44 pairs of warnings like:

/bin/rm -f build_full/bin/tests/BLI_ghash_performance_test
"build_full/CMakeScripts/XCODE_DEPEND_HELPER.make:42: warning:
ignoring old commands for target
`build_full/bin/tests/BLI_ghash_performance_test'"

/bin/rm -f build_full/bin/tests/BLI_ghash_performance_test
"build_full/CMakeScripts/XCODE_DEPEND_HELPER.make:3523: warning:
overriding commands for target
`build_full/bin/tests/BLI_ghash_performance_test'"

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D8815
2020-09-08 00:23:48 +05:30
Ankit
40dcf686f0 Support ASan library on macOS for all generators.
This change allows macOS developers to use
`WITH_COMPILER_ASAN` with every generator.

`CMAKE_C_IMPLICIT_LINK_DIRECTORIES` on macOS points to
`Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/lib`
which is not where the Sanitizer libraries are.

To link the library, rpath could be used but that seems complex,
so linker flags are passed as the documentation says. [1]

If users have `ASAN_OPTIONS=detect_leaks=1` in their environment
variables, it should be removed to avoid a feature-unsupported error
while compiling.

[1]: http://clang.llvm.org/docs/AddressSanitizer.html#usage

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D8817
2020-09-08 00:19:07 +05:30
de21ab418d Add a Self option to the Exact boolean modifier. Fixes T52425.
With this option, self-intersections in either or both operands
will be handled properly (if both sides are piecewise winding
number constant, and maybe some other cases too).
In the Boolean tool, this flag was there already but the code
forced a unary operation in that case; this commit corrects it
to make a binary operation. This flag makes the code slower, which
is why it is an option and not an always-on thing.
2020-09-07 14:29:12 -04:00
19f56cfe6c Cleanup: GLBackend: Move buf_free and tex_free to GLContext
This makes it easier to follow.

Also removes the GL related functions inside gpu_context.cc.
2020-09-07 20:17:45 +02:00
58353834f4 GPUCapabilities: Isolate GL memory statistics
This is part of the Vulkan task T68990

This is a simple cleanup.
2020-09-07 20:17:45 +02:00
c5c6b5ddb3 GPUCapabilities: Isolate GL_STEREO to GLContext
This is part of the Vulkan task T68990

This is a simple cleanup.
2020-09-07 20:17:45 +02:00
d2911124f4 BLI: improve exception safety of VectorSet
For more information see rB2aff45146f1464ba8899368ad004522cb6a1a98c.
2020-09-07 20:04:00 +02:00
6b436b80a4 GPU: Rename gpu_extensions to gpu_capabilities
This makes more sense as this module has more to it than just
GL extensions.
2020-09-07 19:37:05 +02:00
5de4525e39 GPUTexture: Bump GPU_TEX_MAX_FBO_ATTACHED
This was causing an assert when using `--debug-gpu-force-workarounds`
2020-09-07 19:37:04 +02:00
a784e90be0 EEVEE: Try to allocate the lightcache and use fallback if failure
This is to remove an explicit opengl dependence to GPU_extension.
2020-09-07 19:37:04 +02:00
171b36683a GPUExtensions: GL backend isolation
This is part of the Vulkan task T68990.

This commits changes a few things:
- Rename extensions to capabilities (but left the file name untouched).
- Cubemap mip render workaround detection is rewritten using gl
  commands to avoid using the GPU API before initialization.
- Put all the capabilities that are only relevant for the GL backend
  inside GLContext as static variables.
- Cleanup the names of the limit variables.
- Separate all GL related workaround search inside the GL module.
2020-09-07 19:37:04 +02:00
360489c751 GPUPlatform: GL backend isolation
Part of the vulkan implementation T68990.

Pretty straight forward. Just move the GL code inside the GLBackend and
make the GPUPlatformGlobal a class object.
2020-09-07 19:37:04 +02:00
9cac181fbe Audaspace: port changes from upstream.
Adds possibility to report progress during audio mixdown.
2020-09-07 18:12:45 +02:00
53ca638f2b Cleanup: Clang Tidy, readability-inconsistent-declaration-parameter-name
No functional changes.
2020-09-07 18:10:57 +02:00
1291c7add6 Cleanup: Refactor object.parent_set operator
Refactor the operator exec function into a few smaller functions. The exec
function was mixing up vertex-parent and non-vertex-parent code, including
incorrect comments.

No functional changes.
2020-09-07 18:10:57 +02:00
675c964442 Sculpt: Sculpt Trimming gestures tools
This implements Box Trim as a boolean based trimming too gesture in sculpt
mode. This is the intended way to remove parts of the sculpt instead of
using box mask and mask slice. It also creates new face sets for the new
faces created after the boolean operation.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D8766
2020-09-07 17:31:34 +02:00
Pablo Dobarro
1dc11d15a6 Fix T79914: Grab active vertex using wrong coordinates
This was introduced in the first commit of the cloth brush. In order to
support the cloth brush deformations with subsurf modifiers, the sculpt
API was changed to return the deformed coordinates from the PBVH instead
of the mesh coordinates. When using grab active vertex and rendering the
original mesh wireframe it should render the undeformed mesh coordinates
when available.

Reviewed By: sergey

Maniphest Tasks: T79914

Differential Revision: https://developer.blender.org/D8630
2020-09-07 17:26:21 +02:00
bbbfd7130a Fix Boundary Brush not working with partially hidden meshes
Now when a mesh is partially hidden using Face Sets, the open boundary
the hidden geometry produces is also detected by the brush.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D8819
2020-09-07 17:22:47 +02:00
0c4b732ef2 Fix T78225: Vertex Colors not showing in edit mode
This should be using the mesh_cd_ldata_get_from_mesh function in
order to get ldata from BMesh in edit mode.

Reviewed By: sergey

Maniphest Tasks: T78225

Differential Revision: https://developer.blender.org/D8818
2020-09-07 17:21:49 +02:00
179bd1ea7d Fix T77763: Wrong highlight of active grab vertex
The "Grab Active Vertex" in sculpt mode highlights the vertex and
the neighbor vertices. This was working wrong in the case when mesh
has multires modifier at sculpt level 0 and has shape keys.

The issue was caused by the wrong crazy space calculation, which was
ignoring subdivision level. This is an oversight from the initial
implementation: the modifier has no effect if the subdivision level
is 0.
2020-09-07 16:56:41 +02:00
231d08cbb1 Multires: Fix memory leak when multires is at level 0
There is no SubdivCCG created in this case, meaning ownership of the Subdiv
was not altered.
2020-09-07 16:44:18 +02:00
9681708c1c Fix T80561: Crash when multi-mesh editing UVs with proportional editing
Because of a `goto` we would free a variable before it was declared.
Declare it before the `goto` and `NULL`-check the value before freeing.
2020-09-07 16:17:07 +02:00
d71458d919 BLI: add comparison operators for StringRef
The semantic of those is the same as for std::string_view.
2020-09-07 16:10:01 +02:00
0774fdbeb6 Cleanup: tabs in CMake files 2020-09-07 23:12:34 +10:00
0e5aa49e1d Cleanup: include missing header files in CMake 2020-09-07 23:10:17 +10:00
870fcb3857 Cleanup: change Python version checks to include newer versions 2020-09-07 22:58:16 +10:00
272c53f8f0 datatoc_icon: remove Python 2.x support
This was originally included in case the system Python was v2.x,
remove support since Python 2.x is no longer being maintained.
2020-09-07 22:55:55 +10:00
5ccdc6ad86 Cleanup: Fix clang-tidy warning in the new boolean code
No functional changes.
2020-09-07 14:26:10 +02:00
6b91c641e8 GPU: Fix clang tidy warnings 2020-09-07 14:03:03 +02:00
aa32e7a2f3 Cleanup: GPUVertBuf: Replace TRUST_NO_ONE by BLI_asserts and ifdef DEBUG 2020-09-07 13:59:51 +02:00
c38debd39f GPUVertBuf: GL Backend Isolation
Part of the Vulkan port T68990

This makes a few changes in how the data is being handled by the
backend to allow more flexibility in the future.

The overall code logic is left unchanged.
2020-09-07 13:59:51 +02:00
bb2aeb4504 GPUVertBuf: Rename GPUVertBuf to VertBuf and add some getters
to avoid more typecasts.
2020-09-07 13:59:51 +02:00
99e3541d3b Docs: add note on updating startup defaults to dna_defaults
Without this it's not clear which defaults these values are used for.
2020-09-07 21:02:15 +10:00
a292106799 Fix T80531: Dope Sheet Shape Key Editor search/filter not working
Looks like this has just not been implemented before.
Use the name matching method used in other Dope Sheet UI modes.

Maniphest Tasks: T80531

Differential Revision: https://developer.blender.org/D8824
2020-09-07 12:02:11 +02:00
b351607996 Cleanup: update comment after Clang-Tidy bugprone-incorrect-roundings fixes
Remove the comment about adding `0.5`, as this is no longer done (since
fb5e2f5610).

No functional changes.
2020-09-07 10:12:12 +02:00
d122911d10 Fix mistake in Clang-Tidy bugprone-incorrect-roundings fix
Remove a `+ 0.5` that I overlooked in fb5e2f5610.
2020-09-07 10:09:02 +02:00
7170f7a041 EEVEE: Shaders tests
This will add the remaining static shaders to the eevee shader test suite.

- Downsampling
- GGX LUT generation
- Mist
- Motion Blur
- Ambient Occlusion
- Render Passes
- Screen Raytracing
- Shadows
- Subsurface
- Volumes

Reviewed By: Clément Foucault

Differential Revision: https://developer.blender.org/D8779
2020-09-07 08:21:41 +02:00
267b8e1a5c Cleanup: spelling
Also correct wrapped lines of example code in threads.cc.
2020-09-07 16:19:42 +10:00
379d5d7349 Cleanup: OBJECT_OT_collection_instance_add
Minor changes to match OBJECT_OT_data_instance_add.

- Access properties once & reuse them.
- Early exit when the data to instance can't be found.
2020-09-07 14:43:13 +10:00
955a4142ec Cleanup: use doxy comments in object.c 2020-09-07 14:33:24 +10:00
c350d1eb13 Cleanup: remove redundant scene argument in BKE_object_add 2020-09-07 14:09:50 +10:00
c695523687 Fix OBJECT_OT_data_instance_add creating empty data-blocks
ED_object_add_type creates empty object data, add
ED_object_add_type_with_obdata which can take existing object data.
2020-09-07 13:56:22 +10:00
d268a43b25 Cleanup: GPUVertBuf: Replace GPU_vertbuf_create by GPU_vertbuf_calloc
This is a simple cleanup to make naming consistent with the rest of the
module.
2020-09-06 22:13:06 +02:00
158cea83b5 GLTexture: Fix crash with --debug-gpu on windows + nvidia
The combination of DSA + CubeMap seems to not please this driver.
2020-09-06 22:13:06 +02:00
7ffff04e49 GPUVertBuf: Make GPUVertBuf private to the GPU module
This is just a cleanup to isolate the internals of the vertbuf.
This adds some getters to avoid refactor of existing code.
2020-09-06 22:13:06 +02:00
98fc3f263c Cleanup: GLBackend: Fix missing override keywords producing warnings 2020-09-06 22:13:06 +02:00
4ea93029c6 GPUIndexBuf: GL backend Isolation
This is part of the Vulkan backend task T68990.

There is no real change, only making some code re-organisation.
This also make the IndexBuf completely abstract from outside the
GPU module.
2020-09-06 22:13:06 +02:00
84d67bd0a9 Cleanup: GPU: Rename GPU_element to GPU_index_buffer
Makes it follow the functions names.
2020-09-06 22:13:06 +02:00
32d0918f3d GPencil: Remove console warning in RENDER_PT_gpencil panel
COMPAT_ENGINE was missing
2020-09-06 19:03:12 +02:00
18e205079c GPencil: Cleanup unused code
The poll method is not used
2020-09-06 18:52:37 +02:00
e56ff76db5 Viewport: support dropping object-data to create instances
This allows orphan object data for example (meshes, curves, etc)
to be dropped into the 3D View from the outliner,
creating a new object instance.

Previously the only way to do this was to add the same type of object
then swap it's data through the ID selector drop-down.
2020-09-06 18:42:16 +10:00
5faf72bb71 Fix T75827, boolean of non-manifold objects leaves stray edges.
Well, this only fixes the example if one uses the new Exact mode,
but since that is available, seems fair to call this fixed.
Since these were not closed-volume operands, the Exact mode needed
some adjustment to the threshold used for "inside-outside" tests
for the case of deciding if the cutter is inside the other shape
for a Difference.
2020-09-05 16:01:39 -04:00
8c4f7e6d04 GLState: Use unsigned long long instead of unsigned long for shifts
This fix a compilation warning on msvc.
2020-09-05 18:50:07 +02:00
ffec86bb62 Cleanup: clang-format 2020-09-06 02:21:27 +10:00
3a8d9198b3 Cleanup: spelling 2020-09-06 02:19:58 +10:00
9978485e82 Makefile: update spell checking targets
Update check_spelling targets to match changes to the utility,
take an optional CHECK_SPELLING_CACHE argument.
2020-09-06 02:19:58 +10:00
69377784f5 Fix T67265: Status bar is overlapped by workspace layout
The issue was that the screen geometry calculations scaled down the
areas, but the header would become too small. So it would be upscaled
again towards the lower screen edge (where the status-bar is at). Now we
do another pass over the geometry calculations, until all areas fit into
the screen, or until some rather arbitrary maximum is reached.

This fixes the issue for common cases. Extreme cases, with many
vertically stashed editors and a too small window to show all, are still
not too well supported. Blender keeps working but the status-bar is
still overlapped. We could deal with this better but what's there now
should be good enough.
2020-09-05 18:16:50 +02:00
7d8a252c17 Cleanup: Add const to BKE screen function 2020-09-05 18:16:50 +02:00
581c35bea8 GLState: Fix compilation warning on MSVC 2020-09-05 18:16:13 +02:00
03b36abbe6 GLTexture: Fix undefined behavior when binding textures the first time 2020-09-05 18:13:33 +02:00
9764d3e4dc GLDebug: Trim NVidia debug output
These buffer detailed infos are not needed unless going deep into
perf. profiling, in which case you can still disable this compile option.

This makes user report log much more readable.
2020-09-05 17:49:14 +02:00
71872e3809 GLTexture: Add Feedback loop check
The check is better than before as we take into
consideration the attached mip level.
2020-09-05 17:49:14 +02:00
14926a81b6 Cleanup: GPUFramebuffer: Remove unused variable 2020-09-05 17:49:14 +02:00
64490bdedb GLTexture: Add direct state access support 2020-09-05 17:49:14 +02:00
558e1158e7 GLState: Add texture multibind and remove redundant binds 2020-09-05 17:49:14 +02:00
6560a1c35e Math Utils: Add bitscan 64bit version 2020-09-05 17:49:14 +02:00
44b3985a18 GPUTexture: OCIO: Workaround new missing bind error checking
We cannot change the texture bind point since the interface count
4/5 textures to bind. Changing the uniform to avoid one bind
make the system thinks one texture is missing.

Avoid this by creating a dummy texture and binding it to the empty
slot.
2020-09-05 17:49:14 +02:00
65a593f6ef GPUDebug: Only enable resource checking in debug mode 2020-09-05 17:49:14 +02:00
8e4c0efbe3 Cleanup: GPUTexture: Move debug messages outside of creation function
# Conflicts:
#	source/blender/gpu/intern/gpu_framebuffer.cc
2020-09-05 17:49:14 +02:00
ab95cdaba9 GPUTexture: Change texture creation API
This is to modernize the API:
- Add meaningful name to all textures (except DRW textures).
- Remove unused err_out argument: only used for offscreen python.
- Add mipmap count to creation functions for future changes.
- Clarify the data usage in creation functions.

This is a cleanup commit, there is no functional change.

# Conflicts:
#	source/blender/gpu/GPU_texture.h
2020-09-05 17:49:14 +02:00
bac4606937 Cleanup: GPUTexture: Remove use of GPU_texture_create_nD
Use creation + update function instead.
2020-09-05 17:49:14 +02:00
7d4adbdfab GLTexture: Add validation for empty slots before drawing
This is to have better error detection in debug builds.
This is not a replacement for a full check like in renderdoc but it
might catch some issues early on.
2020-09-05 17:49:14 +02:00
541de201fe OCIO: Use GPUTexture instead of OpenGL calls and remove gl dependency
Simple cleanup. Part of the Vulkan Port T68990.
2020-09-05 17:49:14 +02:00
cc0410193d GPUTexture: Implement back 3D texture resize
But this time implement it outside the texture module.
This makes more sense as only the volume textures need this feature.
2020-09-05 17:49:14 +02:00
78dcd92edb BLI: Math: Add equals_v3v3_int 2020-09-05 17:49:14 +02:00
895ec05212 Cleanup: GPUTexture: Clean framebuffer attachment 2020-09-05 17:49:14 +02:00
13305fb513 Cleanup: GPUFrameBuffer: Use Texture class instead of gl calls 2020-09-05 17:49:14 +02:00
b100b77fda GLTexture: Add back texture proxy check
Cleanup the feature itself:
- Check 3D textures size against the correct limit.
- Add check for compressed textures.
2020-09-05 17:49:14 +02:00
31c77a14af GPUTexture: Add support for samplers
This just add back the support.
This commit also includes a bit of cleanup.

# Conflicts:
#	source/blender/gpu/GPU_texture.h
2020-09-05 17:49:14 +02:00
c766d9b9dc GPUTexture: GL Backend Isolation
This is a massive cleanup needed for vulkan support T68990. It provides:

- More meaningful enums with conversion functions.
- Less hacky supports of arrays and cubemaps (all considered layered).
- More inline with the stateless design of vulkan and modern GL.
- Methods Fallbacks are using framebuffer functions that are wrapped
  instead of implementing inside the texture module.

What is not in there:
- API change.
- Samplers support (breaks a few effects).

# Conflicts:
#	source/blender/gpu/GPU_texture.h
2020-09-05 17:49:14 +02:00
db21c12abe GPUFramebuffer: Encapsulate single attachement clear
This is in preparation of using it to clear single texture.

Also includes minor cleanups about not using tex target in
assert and adding enum operators.
2020-09-05 17:49:14 +02:00
22a84a673a Cleanup: EEVEE: Use correct array size and use equals_v2v2_int 2020-09-05 17:49:14 +02:00
a92d77acf7 GPUTexture: Add skeleton of the new GLTexture class 2020-09-05 17:49:14 +02:00
f72c1c4547 GPUTexture: Remove bind to edit calls
This is going to be unecessary after the GPU opengl texture backend refactor.

For now add a save/restore mechanism to leave the state untouched.

Also remove some calls where the caller would bind to particular binding
point and set the shader uniform.
2020-09-05 17:49:14 +02:00
c598e939ad UI: Masking: Add more transform operators to menu
Also use select tweak params for grabbing points
2020-09-04 22:19:34 -04:00
4155d77026 UI: Masking: Reorginize mask menu to be more conistent 2020-09-04 22:19:33 -04:00
da6e6e0432 New boolean: Fix second example in T79404.
The code to detect non-trivial coplanar intersection sometimes
falsely said there wasn't one. This caused some coplanar intersections
to be missed. Also added a test for this case.
2020-09-04 20:59:36 -04:00
cf0ba59e31 Fix Cycles redefining some Blender macros
These changes were accidentally copied over from the Cycles repository, remove
them again.
2020-09-04 23:32:23 +02:00
e73c60f1bd Fix Cycles unsetting most GCC and Clang C++ flags
Caused by f04260d8c6.
Cycles' CMake defines macros with the same name as Blender, which
override the Blender ones. There's however a small difference in the
re-defined `remove_cc_flag()`, the Cycles version only takes one flag at
a time. So I guess Blender's calls to it would only result in the first
flag being removed.
Of course Cycles shouldn't override any Blender macros, but I'll leave
that up to Brecht to fix properly.
2020-09-04 21:57:32 +02:00
e6f0b60c2e UI Code Quality: Use derived struct for number buttons
For the man rationale behind this design, see 49f088e2d0. Further,
this removes users of uiBut.a1/uiBut.a2, which is a very ugly design
choice (hard to reason about).

Note that I had to do rather ugly, specific exceptions for the number
buttons in `ui_def_but_rna()`. But once all users of a1/a2 are removed,
this special handling shouldn't be needed anymore.
I also had to move a sanity check out of the button definition. It's now
moved into a new debug only sanity checking function executed when
finishing the layout definition (block end).
2020-09-04 21:26:31 +02:00
47881791be UI Code Quality: Store curve-button gradient type in derived struct
We want to move away from using `uiBut.a1`/`a2`, which is a hard to
reason about design.

Part of T74432.

Also correct comment.
2020-09-04 21:26:30 +02:00
120f4507f6 Fix building on windows after cleanup changes in tiff.c 2020-09-04 21:24:06 +02:00
0b3ef67b79 Cleanup: Remove redundant redeclaration in collada
No functional changes.
2020-09-04 21:18:37 +02:00
2115232a16 Cleanup: Clang-Tidy readability-inconsistent-declaration-parameter-name fix
No functional changes
2020-09-04 21:04:16 +02:00
e43d482cc9 Fix T80426: Crash when deleting custom orientation
Indices referencing other orientations were not being updated,
2020-09-04 15:01:04 -03:00
1767a7c986 Fix build error on macOS after recent changes 2020-09-04 19:35:05 +02:00
e58ec74046 Cleanup: fix compiler warnings for MSVC 2020-09-04 17:10:50 +02:00
f04260d8c6 CMake: refresh building and external library handling of Cycles standalone
* Support precompiled libraries on Linux
* Add license headers
* Refactoring to deduplicate code

Includes work by Ray Molenkamp and Grische for precompiled libraries.

Ref D8769
2020-09-04 17:10:50 +02:00
417695e4a8 Curve Profile: Miscellaneous cleanup
- Declare variables where they are initialized
- Use consistent variable and static function names
- Use helper functions more for common operations
- Remove use of BezTriple struct, use CurveProfilePoint instead
- Apply small simplifications to code in some situations
2020-09-04 10:56:56 -05:00
ce67a9d39f Cleanup: Clang-Tidy bugprone-copy-constructor-init fix
No expected functional changes.
2020-09-04 17:17:57 +02:00
587f75f009 Cleanup: Use function pointers in sculpt gestures
This replaces the switch case and operation types with a
SculptGestureOperation struct with callbacks.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D8798
2020-09-04 16:42:05 +02:00
985cc48fca Cleanup: Use function pointers in geometry extract
This replaces the switch case with function pointers to
extract masks or face sets.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D8796
2020-09-04 16:41:05 +02:00
3215651f47 Cleanup: Clang-Tidy, describe current status of rules
No functional changes.
2020-09-04 16:29:18 +02:00
fb5e2f5610 Cleanup: Clang-Tidy bugprone-incorrect-roundings fixes
Should cause no noticeable difference.
2020-09-04 16:23:08 +02:00
ee49ce482a GPencil: Change Interpolate shortcut to Ctrl+E
Before the shortcut was Ctrl+Alt+E, but it's more logic remove the Alt.

Reviewed by: @mendio, @pepeland
2020-09-04 16:11:17 +02:00
97871e16ff GPencil: New option to set steps in Interpolate Sequence
Sometimes interpolate all frames is not convenient and it's better, for example, interpolate in twos.

The new parameter allows to define the number of frame for each step, by default is set to 1 as before.

{F8812621}

This is a request of animators to improve interpolate tools.

Reviewed By: mendio

Maniphest Tasks: T80190

Differential Revision: https://developer.blender.org/D8723
239b0b
2020-09-04 15:36:02 +02:00
767916eefc Cleanup: more Clang-Tidy readability-const-return-type fixes
Building with `WITH_GMP=ON` revealed more const-return-type issues.

No functional changes.
2020-09-04 14:53:53 +02:00
9f5c30797d Cleanup: typo fix in a comment
No functional changes.
2020-09-04 14:13:34 +02:00
570811f0ef Cleanup: Enable Clang-Tidy readability-qualified-auto rule
No functional changes. No changes except enabling the rule, even.
2020-09-04 13:39:32 +02:00
e72a520a4c Cleanup: Clang-Tidy readability-redundant-declaration fix
No functional changes.
2020-09-04 13:31:10 +02:00
cc2b114a21 Cleanup: Clang-Tidy readability-static-accessed-through-instance fixes
No functional changes.
2020-09-04 12:37:56 +02:00
3e3e42cbcb Cycles: Cleanup, mark overridden virtual methods as such
Solves strict Clang warnings reported on Linux.
2020-09-04 12:37:25 +02:00
8057ab10db Cleanup: Clang-Tidy readability-const-return-type fixes
No functional changes.
2020-09-04 12:04:47 +02:00
371ddda4d0 Cleanup: Clang-Tidy readability-redundant-preprocessor fixes
Remove redundantly nested `#if` and `#ifdef` statements.

One nested `#if 0` block was left untouched, as it's in particle code
that's no longer maintained. Furthermore, that block also has some
explanation as to the differences between the enabled & disabled parts.

One nested `#if 0` construct was completely removed, leaving only the
actually used bit of code. There was no explanation as to the usefulness
of the disabled code, and it hasn't been touched in years.

No functional changes.
2020-09-04 11:26:26 +02:00
aa4cf47e40 Fix T80273: Restrict option in weight paint doesn't work with gradient
With the 'Restrict' option, the gradient should be restricted to the
assigned vertex, just like the other weight paint tools.

Maniphest Tasks: T80273

Differential Revision: https://developer.blender.org/D8761
2020-09-04 10:30:06 +02:00
2a24b3aaf4 Fix T78084: Search does not accept text fragments everywhere
This was reported for the "Add Node" search functionality, but is
relevant in other searches as well.

So e.g. when searching for "Separate XYZ", typing "sep", then " " (with
the intention to type "X" next) would clear the search field. Now use
the same method (matching against all search words) as in F3 searching
('menu_search_update_fn') in other searches as well [searching IDs,
property objects, finding nodes,...]

This should give a much nicer search experience in general.

Note: this does not touch other searches in the Dopesheet, Outliner,
Filebrowser or User Preferences that have other search implementations.

Maniphest Tasks: T78084

Differential Revision: https://developer.blender.org/D8232
2020-09-04 10:11:45 +02:00
92b8d7019b UI: Make UV Editor contextual menu more consistent with 3D View
Follow up on rB12716e6b9fc74bd53be39ec7aab16ca8d43f0593

See also: rB62774badeda7d13fd3c6af57c632ff3167a608d7
2020-09-03 22:27:39 -04:00
f9bd3329e6 Docs: Fix typo in creator args formatting
This was pointed out in D8799
2020-09-03 20:41:25 -04:00
a96283ba51 Fix assert when cleaning constraints in the transform tool
When enabled, the modal key item "Clear Constraint" did not reset
the default orientation.

This does not bring changes in the user's point of view.
2020-09-03 17:57:58 -03:00
ff3a9852a7 Cleanup: Shorten the name of the Auto Constraint modal keymap
It was taking up too much space in the status bar.
2020-09-03 17:57:42 -03:00
953a031f15 UI: Fix use after free for instanced panel expansion
The "set_expand_from_list_data" function has to be called after updating
the panels' custom data pointers. Otherwise the wrong information is
retrieved in the best base and it will cause a crash in the worst case.
2020-09-03 14:33:44 -05:00
88b6dd1392 Fix missing cursor changes with "Lock Object Modes" disabled
Changing the active object would change the mode, but the necessary
toolsystem update to change the cursor was not run.

Steps to recreate were:
* Duplicate default cube
* Enter sculpt mode with one of the cubes
* Disable Edit > Lock Object Modes
* Select back-and-forth between the objects

Same would happen with other modes.
2020-09-03 21:04:17 +02:00
c7b00ef625 MSVC: Fix cmake warnings with MSVC updates
CMake caches the location of the CRT runtime in the
MSVC_REDIST_DIR variable, and uses it to copy the required
dll's during the install phase.

This variable is only initialized when it does not exist.
Leading to issues when compiler updates are installed and
the compiler version slightly changes, cmake still looks
in the old location for the runtime and warns about the
files not existing.

This change fixes the issue by checking if the redist dir
exists and if not unsets it so InstallRequiredSystemLibraries
can have another go at figuring out where they live.
2020-09-03 12:39:49 -06:00
19fff96ef5 Fix T80289: GPencil Opacity modifier not working
This error was introduced in the refactor of the modifier panels.
2020-09-03 20:17:09 +02:00
6d39fd94b4 Fix copy/paste error in Grease Pencil Draw operator tooltip
Also remove capitalization of the term "object".
2020-09-03 19:36:52 +02:00
340cbc7f15 Fix T79803: Wrong Distance To Edge 1D Voronoi
The current 1D Voronoi implementation for the Distance to Edge option
computes the distance to the cells instead. This patch fixes that and
compute the distance to the edge.

Reviewed By: JacquesLucke, brecht

Differential Revision: https://developer.blender.org/D8634
2020-09-03 18:56:27 +02:00
d2c52d4de2 Cleanup: Add/use function to disable buttons with a disabled hint
We do this in a couple of places, so it's worth having the logic wrapped
into a function.
Also, the only way to set the disabled hint for a button from outside of
`interface/` was through `UI_block_lock_set()`/`UI_block_lock_clear()`,
for which the usage isn't obvious when you just try to disable a single
button.
2020-09-03 17:46:23 +02:00
d8a80e5949 Revert "Fix T59358: Wrong status bar keymap for release confirms and right click select."
This reverts commit 17905e89a7.
Fix T80429: Transform Tools cannot be cancelled

rB17905e89 better filtered the key items that should appear in the
status bar.

But it is very restrictive since canceling is still possible in other
cases.


# Conflicts:
#	source/blender/editors/transform/transform.c
2020-09-03 12:33:44 -03:00
afb43b881c Sculpt: Face Set Extract Operator
This implements a Face Set Extract operator, which is similar to mask
extract. This operator uses a picker to select and Face Set in the mesh
and extract the geometry directly to a new object.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D8599
2020-09-03 17:26:12 +02:00
c8e5924cbb UI: Expose important settings from file browser popovers
We have established a convention of exposing the most important
settings from popovers, then aligning a popover to control more
detailed settings.

The file browser has powerful display / filtering settings, but
they're hidden in popovers at the moment, so it's sometimes a pain
to use them. The "display as" options are now exposed to the left of
the display settings popover, and the "filter" toggle is exposed to
the left of the filter settings popover. This convention is familiar
and intuitive for users and makes interaction faster.

Note that the "show hidden" item in the filter popover still has an
effect if filtering is disabled.

This commit also:
 - Removes the icons in the "Sort By" enum
 - Uses property split for the "Sort By" enum
 - Very slightly increases the default width of the file browser
   window to make room for the new buttons.

Differential Revision: https://developer.blender.org/D8719
2020-09-03 10:02:09 -05:00
eb82b3947e Sculpt: Remove unused code in Clay Strips
This was doing a matrix inversion per vertex per stroke step and it was
unused.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D8791
2020-09-03 16:47:18 +02:00
38737f780a Fix cloth brush not working with anchored stroke
All brushes except for grab need delta for tip orientation in order to
work with anchored stroke, not only snake hook, which is the one that
needs it always.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D8789
2020-09-03 16:46:36 +02:00
c05715b03f Sculpt: Sculpt Face Set gestures tools
This implements the sculpt gesture lasso and box operators for face
sets. They work the same way as the mask gesture operator and tools.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D8716
2020-09-03 16:44:40 +02:00
10d61f34bb Fix clang tidy errors in tests 2020-09-03 16:26:45 +02:00
519b2f937f BLI: add index_range method for StringRef 2020-09-03 16:26:45 +02:00
e7d3d0219b Fix T79718: Eevee OpenVDB render error when frames miss part of the grids
Improved fix that handles the distinct cases of missing grids and zero
size grids.
2020-09-03 16:12:30 +02:00
f0c376a52a Fix T80332: principle volume shader not working for world in Eevee
The handling of missing volume grids for the principled volume shader was
incomplete, different inputs need different default values.
2020-09-03 15:49:41 +02:00
Yevgeny Makarov
96439de784 UI: Reduce limits for the text size theme options
It was possible to increase the text size quite a lot, making text much
bigger than their containing widgets. These new limits makes the maximum
size of text be closer to the widget size.
Note that there needs to be some extra "wiggle room" since fonts may
have quite different glyph sizes. So you can still set the font size to
be slightly bigger than the widgets.

Addresses T80175 and T79059.
2020-09-03 15:42:44 +02:00
Philipp Oeser
f00cb93dbe Fix T63125: Gpencil: bones cannot be selected in weightpaint mode
Some underlying functionality was not ready for greasepencil:
- BKE_modifiers_get_virtual_modifierlist (now introduce dedicated BKE_gpencil_modifiers_get_virtual_modifierlist)
- BKE_modifiers_is_deformed_by_armature
- checks in drawing code
- checks in (pose) selection code

A couple of changes to make this work:
- `eGpencilModifierType_Armature` has to be respected (not only `eModifierType_Armature`)
- `OB_MODE_WEIGHT_GPENCIL` has to be respected (not only `OB_MODE_WEIGHT_PAINT`) --  (now use new `OB_MODE_ALL_WEIGHT_PAINT`)
- `gpencil_weightmode_toggle_exec` now shares functionality from `wpaint_mode_toggle_exec` -- moved to new `ED_object_posemode_set_for_weight_paint`

This patch will also set the context member "weight_paint_object" for greasepencil (otherwise some appropriate pose operators wont work when in weightpaint mode)

Reviewed By: campbellbarton

Maniphest Tasks: T63125

Differential Revision: https://developer.blender.org/D8483
2020-09-03 15:01:50 +02:00
a505a85873 Fix 3D text cursor alignment without any text
Part of fix for T80340.
2020-09-03 21:20:56 +10:00
930021129a Quick effects: avoid error in builds without OpenVDB
Differential Revision: https://developer.blender.org/D8626
2020-09-03 12:56:27 +02:00
a04ac5b52d Fix T80391: Overrides: wrong check in constraint poll
Condition was flipped, would allow actions on constraints coming from
library, but prevented actions on local constraints.

Mistake in rBS0b49fdd0ee0.

Maniphest Tasks: T80391

Differential Revision: https://developer.blender.org/D8793
2020-09-03 12:47:54 +02:00
09f966ad16 Fix mistake in recent font cleanup
7ff7a9c8fd missed incrementing the pointer used for initializing.
2020-09-03 20:14:55 +10:00
Stefan Werner
c8b84a13a5 Make deps: Disabled assembly for GMP on Apple/arm64.
This appears to be a configuration for which GMP has no assembly,
yet the default configure script tries to build it.
2020-09-03 10:11:59 +02:00
3cbfe96681 Object: add BKE_object_obdata_to_type utility function
Move functionality to get the object type from an ID
into it's own function.
2020-09-03 16:27:15 +10:00
c017e1cb67 Fix T80409: Walk rotation speed depends on view size
Use a fixed speed for rotating the view in walk mode,
Keep the current behavior for tablet input and fly mode.
2020-09-03 14:31:26 +10:00
fc6b0c6f85 Fix crash running remesh modifier without OpenVDB 2020-09-03 13:32:53 +10:00
2820f7be76 Fix T80340: Crash with an empty text with Text on Curve
Avoid divide by zero, based on D8780 by @lichtwerk.
2020-09-03 13:28:01 +10:00
7ff7a9c8fd Cleanup: remove redundant Y bounds calculation for text on path
Also correct some comments.
2020-09-03 12:28:22 +10:00
99c3ac17f2 Modifiers: default to exact boolean method ignoring build options
This change doesn't impact release builds,
in general avoid having defaults depend on build options
since it means files from different builds won't match.
2020-09-03 10:07:39 +10:00
14e2596d21 UI: pixel align axis navigation characters to resolve blurry text
Also increase text size from 11 to 12 since the default
font at 1.0 scale was a little fuzzy too.

Reviewed by: @pablovazquez

Ref D8781
2020-09-03 09:33:31 +10:00
Pablo Dobarro
89cdf4f75d Fix Cloth Snake Hook brush not using pressure
The Snake Hook deformation mode was using the same strength as grab (not
supporting pressure), but this deformation mode supports pressure.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D8724
2020-09-02 22:33:24 +02:00
fb09bc3c35 Fix T80311: Sculpt Filters not working when using vertical split
All filters were using prevclicx, which is in screen coordinates and
mval[0], which is in region coordinates to get the filter strength.

This fixes the issue in all filters.

Reviewed By: Severin

Maniphest Tasks: T80311

Differential Revision: https://developer.blender.org/D8776
2020-09-02 22:30:59 +02:00
ba4a2a4c8b UI: Use instanced panel custom data instead of list index
For modifier shortcuts we added a "custom_data" field to panels.
This commit uses the same system for accessing the list data that
corresponds to each panel. This way the context is only used once
and the modifier for each panel can be accessed more easily later.

This ends up being mostly a cleanup commit with a few small changes
in interface_panel.c. The large changes in the UI functions are due
to the fact that the panel custom data is now passed around as a
single pointer instead of being created again for every panel.

The list_index variable in Panel.runtime is removed as it's now
unnecessary.

Differential Revision: https://developer.blender.org/D8559
2020-09-02 14:13:26 -05:00
ff7d742350 Quiet all warnings when building Bullet 2020-09-02 21:06:02 +02:00
4446c3a593 Sync Bullet to upstream
This syncs Bullet to the latest upstream git version as of writing this.
(commit 47b0259b9700455022b5cf79b651cc1dc71dd59e).
2020-09-02 20:41:30 +02:00
6f6f6ee186 Fix missing "extern_bullet" library when building rigidbodies 2020-09-02 19:44:29 +02:00
f5e55c3337 Cleanup: use bool instead of int in various places 2020-09-02 19:10:40 +02:00
f20f82ce3e Fix segfaults when deleting objects with upstream bullet lib
Blender tried to free objects twice from the bullet world sometime.

First we would implicity remove all objects when recreating the bullet
world and then explicity try to remove them again from the now empty
world.

This would wouldn't crash older bullet versions, but the recent versions
will as we will try to free objects that no longer exists in the bullet
world.

Also clear the cache on deletion as the object order changes.
Fix T77181: The cache clearing will fix this issue.
2020-09-02 18:35:16 +02:00
9b1f726248 Cleanup: general cleanup of node.c
- reduce variable scope
- use bool instead of int
- use LISTBASE_FOREACH
2020-09-02 18:28:17 +02:00
a8cf9d2f80 UI: Use property split layout for add torus operator
Continuing the work from D8326, this commit adds a property split
layout to the add torus operator. It also puts the properties common
to all object add operators at the bottom for consistency.

Differential Revision: https://developer.blender.org/D8748
2020-09-02 10:34:44 -05:00
4330f147d0 Fix unused variable warning on Windows with WITH_INPUT_IME disabled 2020-09-02 17:32:58 +02:00
c992fd3a3c Cycles: Support WITH_CYCLES_NATIVE_ONLY with MSVC
This change enables the developer option `WITH_CYCLES_NATIVE_ONLY`
for MSVC. This allows a developer to just build the cycles
CPU kernel for their specific system rather than all kernels,
speeding up development.

Other platforms have had this option for years, but MSVC lacks
the compiler switch to target the host architecture hence it
always build all kernels.

This change uses a small helper program to detect the required
flags.

Only AVX/AVX2 are tested, for the following reasons

- SSE2 is enabled by default and requires no flags
- SSE3/4 have no specific build flags for msvc
- AVX512 is not yet supported by cycles

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

Reviewed by: brecht, sergey
2020-09-02 09:19:44 -06:00
1082edfdfd Cleanup: Clang-format 2020-09-02 09:19:14 -06:00
279f7ad8ac Cleanup: Correction to previous cleanup commit
I somehow undid these changes again before committing, sorry for the
noise...
2020-09-02 16:31:23 +02:00
9c3fa99658 Cleanup: Correct argument names in comment
Names were changed in 66b12ef4ab, but the comment wasn't updated.
2020-09-02 16:26:23 +02:00
09ef199965 PY API doc: fix doc for new override option of properties.
Reported by Demeter Dzadik (@Mets) on blender.chat, thanks.

Candidate to be backported to a potential 2.90.1.
2020-09-02 14:59:58 +02:00
1aa54d4921 Make rigidbody simulation handle animated objects gracefully
The animated objects was not updated for each internal substep for the rigidbody sim.
This would lead to unstable simulations or very annoying clipping artifacts.

Updated the code to use explicit substeps and tie it to the scene frame rate.

Fix T47402: Properly updating the animated objects fixes the reported issue.

Reviewed By: Brecht, Jacques

Differential Revision: http://developer.blender.org/D8762
2020-09-02 14:20:41 +02:00
feb4b645d7 EEVEE: Shader tests for Depth of Field
This patch moves the EEVEE depth of field shaders to eevee_shaders.c and
adds them to the eevee shaders test suite.

Reviewed By: Clément Foucault

Differential Revision: https://developer.blender.org/D8771
2020-09-02 13:03:06 +02:00
d851b38185 Cleanup: improve internal function name in 'ngon_tessellate' 2020-09-02 19:33:47 +10:00
cf67ba848f WM: add use_factory_startup option to read homefile operator
There was no way to reset the current file to factory settings
without reloading the preferences (which disables & re-enables add-ons),
this slows down resetting files and can complicate tests.
2020-09-02 17:50:20 +10:00
428a1aaf73 UI: add back Layout.introspect
Add back this function, removed 2e14b7fb97.

Useful for checking operators used in menus.
2020-09-02 15:58:44 +10:00
89ed6b1293 UI: simplify tool-tip logic for operators
- Use WM_operatortype_description to get the operator description.
- Pass properties to WM_operatortype_name,
  so the operator name callback is used.
- Add UI_but_operatortype_get_from_enum_menu function
  to access the operator from enum menus.
- Change WM_operatortype_description to return NULL when there is no
  description, use WM_operatortype_description_or_name
  when either can be used.
2020-09-02 13:01:04 +10:00
ddea2f234f Fix crash accessing image space properties without an active window 2020-09-02 12:44:37 +10:00
957346694d Cleanup: spelling, rename attachement -> attachment 2020-09-02 10:04:50 +10:00
71aa3c864d Cleanup: spelling 2020-09-02 09:58:26 +10:00
ba188e7218 UI: Remove unecessary panel_free_block function
This function was called when the modifier list changes and the panel
list has to be rebuilt. Originally I thought it was necessary to to remove
the block immediately when the panel was removed, but we can just
leave it and it will be removed later in the UI drawing process.

Removing this results in fewer string lookups.
2020-09-01 17:29:17 -05:00
f6ab6dd91a Cleanup: Reduce indentation level and variable scope
Exit early in some functions to reduce indentation level, declare
variables where they are initialized, and also  clean up some
comment formatting.
2020-09-01 16:39:46 -05:00
Stefan Werner
009971ba7a Cycles: Separate Embree device for each CPU Device.
Before, Cycles was using a shared Embree device across all instances.
This could result in crashes when viewport rendering and material
preview were using Cycles simultaneously.

Fixes issue T80042

Maniphest Tasks: T80042

Differential Revision: https://developer.blender.org/D8772
2020-09-01 21:00:55 +02:00
f2d26409e8 Fix T80233: Extrude manifold can generate invalid geometry
Faces with only 2 sides were sometimes generated.
2020-09-01 15:25:30 -03:00
Imre Palik
f6dc6caa15 Fix Cycles build error when disabling some kernel features
Differential Revision: https://developer.blender.org/D8372
2020-09-01 19:14:31 +02:00
2930d4fcea Fix T80031: UI: Use a more specific label for stencil mask opacity
This is not the opacity of the vertex colors itself but of the stencil 
mask.

Follows up on rBbb4478f2fdd8426d6050bf7b7c09611afeb1bd14
2020-09-01 12:56:22 -04:00
d6a9783b71 Cleanup: GLFrameBuffer: Reduce indentation 2020-09-01 18:42:46 +02:00
7edd60b35b GLFramebuffer: Avoid calling method on a partially destroyed GLContext
This avoid an ASAN runtime error.
2020-09-01 18:42:37 +02:00
3c54db4a4e Audaspace: port compilation fix from upstream. 2020-09-01 18:12:48 +02:00
a92ab93c7d Fix T79553: StretchTo constraint: Apply Pose changes bone length
Recompute Rest Length stored in the StretchTo constraint after applying
the current pose as rest pose.

The "Apply Pose as Rest Pose" operator applies the evaluated pose as
rest pose, which means that the change in bone length from the StretchTo
constraint is applied to the rest pose. The bug was caused by the fact
that the StretchTo constraint wasn't updated for the new pose, and thus
still applied the same scale factor to the new pose, effectively
doubling its effect.

The "Apply Pose as Rest Pose" operator now forces a recompute of the
rest length cached in the StretchTo constraint data. As a result, the
length of the bone before and after the pose is applied remains the
same. The X and Z scale (perpendicular to the bone length) are reset to
1.0, as with the applied pose the bone isn't stretched or squashed any
more.
2020-09-01 17:57:42 +02:00
23767937ef USD: remove library initialisation hack
Remove the hack for library initialisation; this is no longer necessary
as the required information can be passed to the USD library after its
static initialisers have run.

This new approach is compatible with both the patched and original USD
library. This means that platform maintainers don't need to rebuild the
USD library until the next upgrade.

Manifest Task: https://developer.blender.org/T80320
2020-09-01 17:29:01 +02:00
fef1a6c54e USD: move library initialisation from main() to USD module
Initialize the USD library when used (instead of at startup), so that
this can happen inside the IO/USD module. This makes calls to the USD
library local to Blender's USD code.

Note that failure to find the USD JSON files will now only be reported
when the USD exporter is used, and not on every startup of Blender.

This is the first step in cleaning up the way Blender patches and
initialises the USD library.

Manifest Task: https://developer.blender.org/T80320
2020-09-01 17:28:05 +02:00
f1b10477c2 GPUOffscreen: Remove scissor and viewport state tracking
This was a workaround that is not needed anymore.

Fix FT80321 Cropped output with Viewport Render Animation
2020-09-01 17:22:57 +02:00
907a718ebe Fix T80224: Crash after duplicating and hiding vertices while using X Axis Mirror
The mirror map can reference a hidden vertex that is currently ignored
in the transformation.

Thus the mirror element array is not filled.
2020-09-01 12:13:34 -03:00
eb911610d0 Fix ugly alignment of "Mono" option in the Sequencer
Steps to reproduce were:
* Open Sequencer, add a sound strip
* In the sidebar, open the Adjust > Sound sub-panel
* Note the placement of the "Mono" item

The layout code would disable decorators if a property came from a
non-animatable data-block type. Doing so would mess up the alignment
where properties from different data-block types were be mixed.
This is not the case any more.

Note that when actually adding the decorator, a blank icon is inserted
to keep the alignment intact when the data-block type isn't animatable.
So the decorator is still not shown, but the alignment looks fine.

This may affect more cases. If so, and if that's an issue, the
decorators should be explicitly disabled.
2020-09-01 17:10:42 +02:00
ee393f9821 Fix (unreported) GPencil cannot deselect points with box/lasso select
Selecting in empty space wasnt considered as 'changed'.

Differential Revision: https://developer.blender.org/D8770
2020-09-01 17:03:09 +02:00
fec522be6a Fix T79941: mantaflow cache doesn't work with ' character in path
The fix is to escape the `'` character as well.

Reviewers: sebbas

Differential Revision: https://developer.blender.org/D8773
2020-09-01 16:33:32 +02:00
a708cdabe6 Fix T80328 Commit introduced build warnings in Windows 2020-09-01 16:16:48 +02:00
7e3967ed37 Gizmo: Navigate: Make use of UI_draw_roundbox_4fv
This improves circles AntiAliasing, and line antialiasing.

This keeps the old drawing method (3d spheres) for the selection pipeline.

This was suggested by @harley on devtalk.
2020-09-01 16:08:50 +02:00
998b680e5b UI: Widget: Add conservative raster to avoid cut widget borders
This avoids incorrect AA when the widget is not perfectly alligned with the
pixel grid.
2020-09-01 16:08:50 +02:00
31004ef48e Transform: Keymap: Enable Auto Constraint with Middle Mouse + Shift 2020-09-01 10:59:16 -03:00
c7287ffaec Transform: remove MOD_CONSTRAINT_PLANE
It conflicts with MOD_PRECISION and was not really working properly.
2020-09-01 10:50:50 -03:00
8170c92ed4 Fix constrain plane masking shift event
This prevented transformation with a precision modifier.
2020-09-01 10:38:37 -03:00
26d5c24f0a Fix T80258: UILayout.prop_search() issues with datablock names
If the search menu was used for a string property, and a data-block was
selected from the search, the value set would be an invalid name. The
property would get the modified UI string, not the proper data name set.

This problem was already once solved in rB249ccab111ac, but resurfaced
in rB937d89afba36.

Now only use the modified UI string if requires_exact_data_name is not
true.

Note: the comments in rB249ccab111ac [reg. library hints and string
properties, also that pointer properties are preferred over string
properties when dealing with IDs] still apply.

Reviewers: campbellbarton

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

(cherry picked from 2.90 commit
cb0b0416f4)
2020-09-01 15:24:26 +02:00
9259052e15 Fix T64267: 'Add Snap Point' does not work with Ctrl pressed 2020-09-01 09:53:35 -03:00
Germano Cavalcante
526fbdec3b Transform: Move some hardcoded keyitems to keymap_data in python
Keymaps must be customized by the user.

But this is not the case for hardcoded keymaps.

Also the repetition of hardcoded and user-defined keyitems may induce
the user to think they have made a mistake or it is a bug.

Differential Revision: https://developer.blender.org/D6454
2020-09-01 09:39:06 -03:00
Stefan Werner
17cf500101 Cycles: Fixed Cycles standalone build.
The node refactor in 429afe0c62 was missing in the standalone code.
2020-09-01 14:13:17 +02:00
07899ddd22 Fix double include of gmp.cmake
This fixes `make deps` complaining about the `extern_gmp` project being
defined twice.
2020-09-01 12:39:58 +02:00
d6d2897ef0 Sequencer: Fix crash caused by stereo rendering fix
Caused by rB2e908156d0c7

This was caused by the sequencer timeline area not using a GPUViewport
but still using `sequencer_draw_preview`.
2020-09-01 12:03:52 +02:00
991eb5f79c Cleanup: GPUContext: Remove unused functions 2020-09-01 12:03:52 +02:00
a6185e4fa5 OCIO: Make GLSL implementation use GPUUniformBuf to avoid debug errors
Now that we use internal state info, we require drawing that uses the
GPU api to use it throughout the whole pipeline. This is in order to
track the GL state and do our own error checking.
2020-09-01 12:03:52 +02:00
53a806f6df GPU: Move UBO binding validation to GL backend
This also make the validation quicker by tracking the currently
bound slots.
2020-09-01 12:03:52 +02:00
5ec0250df9 EEVEE: Volumetric: Fix Mesa Compiler error
The compiler does not seems to understand the `const` in the
function declaration and complains about non constant indexing
of unsized array.
2020-09-01 12:03:52 +02:00
ccf476f8af EEVEE: Volumetric: Fix missing UBO
This is undefined behavior on certain system.
2020-09-01 12:03:52 +02:00
f818d1d636 Cleanup: Fix warnings in our intern bullet api wrapper
No functional changes.
2020-09-01 12:01:50 +02:00
Stefan Werner
45da7ce177 Cycles: Followup fixes for node ownership refactor.
There were some places where nodes still would end up without owners.

See D8540 and 429afe0c62
2020-09-01 11:47:54 +02:00
e8be55a485 Fix: Active rigidbodies would not recive updates after the stopped being animated
Because depsgraph isn't rebuild for animated properies, we have to
assume that active bodies will always want to have updates from the
rigidbody simulation.
2020-09-01 11:41:44 +02:00
c2df6658ee CMake: Fix linking errors with gmp library
gmpxx library (C++ version of gmp) uses symbols from libgmp, which means
the libgmp is to be passed to the linker after libgmpxx.
2020-09-01 11:31:47 +02:00
114150e80c Fix compilation error with -Werror=array-bounds
This error happened only with O2 or O3 in my tests.
Casting to uintptr_t and back seems to quiet the compiler.
2020-09-01 11:11:21 +02:00
1449ae042e Cleanup: EEVEE bloom shaders
- moved to eevee_shaders
- added to test suite

Reviewed By: Clément Foucault

Differential Revision: https://developer.blender.org/D8763
2020-09-01 10:57:20 +02:00
c78c425266 PyAPI: expose 'bl_options' for operators in bpy.ops
Useful for checking which operators are only for internal use.
2020-09-01 17:02:51 +10:00
06ba233374 RNA: rename Area.ui_type 'VIEW' enum identifier to 'IMAGE_EDITOR'
The term makes sense in the image editor, but not among other editors
where we had both VIEW and VIEW_3D.
2020-09-01 16:35:47 +10:00
87aa13d025 PyAPI: prevent leading comma when printing some enums
BPy_enum_as_string (used for creating error messages)
showed a leading comma for enums that used category headings.

While harmless, it looks odd.
2020-09-01 16:32:11 +10:00
76f513f6dc Fix T78601: User count errors when reading home-file
Calling: bpy.ops.wm.read_homefile(use_empty=True)
exposes invalid user-counts in versioning code.

Simplified logic for assigning materials in versioning code.

Caused by 29f3af9527.
2020-09-01 15:00:48 +10:00
a241948ad9 Fix errors ensuring grease pencil palette
- Direct assignment caused ID user counts to be invalid.
- The first palette would always be used,
  even when the named palette searched for was found.

Also pass 'const' string to `hex_to_rgb`, avoid casting to 'non-const'.
2020-09-01 15:00:48 +10:00
d9d0a386cb Cleanup: don't register mix-in menu class
The class is only used as a base for other menus.

This caused complications for tests that inspect menu contents.
2020-09-01 15:00:48 +10:00
8c86c55035 Cleanup: correct doxy sections 2020-09-01 15:00:48 +10:00
bb4478f2fd Fix T80031: UI: "Stencil Opacity" is vague
This affects the mask opacity not the stencil itself.
2020-08-31 23:30:18 -04:00
12c0ecc934 Fix T80100: To sphere tooltip uses "vertices" even in object mode 2020-08-31 23:30:18 -04:00
4e06afb0a1 GL: Fix two GLerror
The gizmo one was only reproducible in debug builds.
The GLImmediate one was only affecting amdpro drivers when --debug-gpu was
enabled.
2020-09-01 00:30:36 +02:00
7f95d780e8 GLImmediate: Use CL_CHECK_ERROR
This provides a bit more debugging info on MacOS.
2020-09-01 00:30:36 +02:00
9d932b426f GL: Move MacOS debug callback to gl_debug.cc
And format to use the same callback as standard debugging layer.
2020-09-01 00:30:36 +02:00
82a197cc7f GPUDebug: Reformat GL debug callbacks and move them to GL backend
Now the callbacks are setup for each debug context.

The formating has been reworked to be less verbose and make errors
and warnings stand out from the notifications.
Errors are most of the time sufficiently explicit in their message.

This also remove the support for AMD_debug_output which is 10 years old.

This is related to the Vulkan port T68990.
2020-09-01 00:30:36 +02:00
058d29ed9a GHOST: Enable debug context on offscreen context too
This was a long standing TODO. This was also preventing debug callbacks
form other context than the main window.
2020-09-01 00:30:36 +02:00
13b0a697a0 Cleanup: GPU: Remove GPU_draw_primitive and default_vao_
These are not used anymore and can be replicated using the GPUBatch API.
2020-09-01 00:30:36 +02:00
052538edc1 Cleanup: Use GPUBatch for icon and area drawing
This is in order to remove GPU_draw_primitive to streamline the drawing
abstraction.
2020-09-01 00:30:36 +02:00
3e7feaff44 Cleanup: Comment formatting in unit.c 2020-08-31 14:18:06 -05:00
fc8533a3c9 New Boolean: Always expose solver propery, add warning
After discussion with @howardt, it seems the solver property should
always be exposed, even in lite builds. This commit removes the
ifdefs for that property and adds a warning if the "Exact" solver is
used when Blender is compiled without GMP.

These changes apply to the boolean modifier as well.
2020-08-31 11:49:22 -05:00
7056f180d3 cleanup: Fix GMP spacing in cmake configurations
It now follows the spacing around it.
2020-08-31 09:42:58 -06:00
3014b5efc8 Fix unused parameter warning in snap_increment_apply_ex()
No functional changes.
2020-08-31 17:37:48 +02:00
f5866f484f Remove patch for HDF5 library
Delete `hdf5.diff`, because it's no longer used. Since Blender 2.90 the
optional support for HDF5 has been dropped, but this file accidentally
wasn't deleted.

See 0102b9d47e and 0c38436227.

No functional changes.
2020-08-31 17:32:28 +02:00
Germano Cavalcante
546b900194 Cleanup/Refactor: Split the snap to increments code
Now we have a better distinction of what is snap to grid and what is
snap to increments.

The code also allows the implementation of mixed snap for these modes.
2020-08-31 11:24:37 -03:00
a1df2fc443 Cleanup: GPU: Remove unused attr_binding and primitive code 2020-08-31 15:15:04 +02:00
1804eb57fd GPUImmediate: GL backend isolation
This is part of the Vulkan backend task T68990.

This is mostly a cleanup, however, there is a small change:
We don't use a special Vertex Array binding function for Immediate
anymore and just reuse the one for batches.
This might create a bit more state changes but this could be fixed
easily if it causes perf regression.

# Conflicts:
#	source/blender/gpu/intern/gpu_context.cc
2020-08-31 15:14:47 +02:00
1b3a0ae231 GLContext: Fix framebuffer deletion to GPUContext
This has more meaning as it's the base class who holds the pointer.

# Conflicts:
#	source/blender/gpu/opengl/gl_context.cc
2020-08-31 15:13:26 +02:00
a54fb081ba Cleanup: GPU_immediate: Change assert to BLI_assert 2020-08-31 15:10:38 +02:00
Germano Cavalcante
a440060142 Fix T79973: Re-ordering face maps messes up the names of other face maps
Use a remap function instead a swap.

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D8739
2020-08-31 09:00:48 -03:00
c83ef9d7b2 Cleanup: reduce variable scope 2020-08-31 13:59:33 +02:00
e9da71ae2d Cleanup: reduce variable scope and use LISTBASE_FOREACH 2020-08-31 12:55:51 +02:00
c5b9bf32e9 Fix T80126: Alembic Import dialogue has overwrite protection UI
Use `FILE_OPENFILE` when importing, rather than `FILE_SAVE`.

Reviewed By: sybren

Differential Revision: https://developer.blender.org/D8715
2020-08-31 12:39:01 +02:00
1c2ade053a Linux: 2.90 release information in appdata 2020-08-31 11:21:01 +02:00
6879798202 Cleanup: Resolve unused variable warning in lite build 2020-08-30 22:47:05 -05:00
596b30a080 Clang Tidy: Fix readability-delete-null-pointer warnings 2020-08-30 18:58:40 -05:00
429afe0c62 Cycles: introduce an ownership system to protect nodes from unwanted deletions.
Problem: the Blender synchronization process creates and tags nodes for usage. It does
this by directly adding and removing nodes from the scene data. If some node is not tagged
as used at the end of a synchronization, it then deletes the node from the scene. This poses
a problem when it comes to supporting procedural nodes who can create other nodes not known
by the Blender synchonization system, which will remove them.

Nodes now have a NodeOwner, which is set after creation. Those owners for now are the Scene
for scene level nodes and ShaderGraph for shader nodes. Instead of creating and deleting
nodes using `new` and `delete` explicitely, we now use `create_node` and `delete_node` methods
found on the owners. `delete_node` will assert that the owner is the right one.

Whenever a scene level node is created or deleted, the appropriate node manager is tagged for
an update, freeing this responsability from BlenderSync or other software exporters.

Concerning BlenderSync, the `id_maps` do not explicitely manipulate scene data anymore, they
only keep track of which nodes are used, employing the scene to create and delete them. To
achieve this, the ParticleSystem is now a Node, although it does not have any sockets.

This is part of T79131.

Reviewed By: #cycles, brecht

Maniphest Tasks: T79131

Differential Revision: https://developer.blender.org/D8540
2020-08-30 23:49:38 +02:00
19363880a6 New boolean: silence an "unused" warning.
Previous commit stopped using some functions. Since I may need
them again for future performance tuning, these are just ifdef'd out
for now.
2020-08-30 14:11:36 -04:00
3fa1280132 Fix T79940 VSE Editor crash when opening a different scene as a strip
This was caused by a double lock of the DRW context mutex.

This changes the logic a bit by releasing the DRW context before rendering
with BKE_sequencer_give_ibuf and restoring it after.

Critical fix for 2.91

Reviewed By: dfelinto
Differential Revision: https://developer.blender.org/D8657
2020-08-30 19:58:54 +02:00
19c9b27ffe New boolean: another performance improvement.
Instead of calculating exact normals for all faces, just do it
for those that potentially intersect. A big improvement for dense
meshes that only intersect in relatively few places.
2020-08-30 13:47:18 -04:00
ade8d84fe3 GPUFrameBuffer: Fix build error on MSVC
This also gets rid of the macro.
2020-08-30 19:07:49 +02:00
0299817e0e Fix T80138 Node Editor: Add Frame turns background gray
The removed `UI_ThemeClearColor` made no sense in this context. It must
have been a leftover from previous refactor.
2020-08-30 18:24:19 +02:00
3699d6fe34 Re-enable modifer and bmesh_boolean tests.
These were disabled in the newboolean merge commit.
This commit renables them, using the original 'FAST' solver
so that the result objects need not change.
A TODO to add more tests using the 'EXACT' solver,
though most functionality there is now covered by unit gtests.
2020-08-30 08:31:40 -04:00
dee665b462 GPUShader: Improve shader compilation log
- Print shader type (fragment, vertex, geom)
- Support for Apple + intel error format.
- Handle formatting a bit more gracefully.
2020-08-30 13:35:25 +02:00
ad5d5d3f3b EEVEE: Fix broken rendering caused by SSR + Alpha blended material
This was affecting Mesa drivers as well as AMD pro driver. But it
might have been noticeable on other config too.

This was introduced by rBa9f2ebb21508.
2020-08-30 13:11:03 +02:00
d98c722a5a GPUFramebuffer: Tag dirty after recursing downsample
Also do not bind automatically. This is fine since the framebuffer will
update next time it's bound.
2020-08-30 13:11:03 +02:00
8527d84d35 GPUState: Move Scissor and Viewport state to framebuffer
This way it is way clearer what each viewport state is. There is
no more save and reset. The scissor test is also saved per
framebuffer.

The only rule to remember is that the viewport state (size and
origin) is reset for both the viewport and scissor when a texture
is attached or detached from an attachment slot.
2020-08-30 13:11:03 +02:00
4f395c84fe BLI_math_vector: Add equals_v4v4_int 2020-08-30 13:11:03 +02:00
0f372f3966 GPUContext: Update internal framebuffer size when activating context
This is to ensure the FrameBuffer extents are always up to date.
2020-08-30 13:11:03 +02:00
bb530a77b6 BLI_utildefines: Fix assignment in binary ops for ENUM_OPERATORS
That was an overlook from the review when we introduced it.
2020-08-30 13:11:02 +02:00
83f144b176 WM: Remove 10year old workaround for buggy drivers
This should have no consequence nowadays.
Can be reverted if needed.
2020-08-30 13:11:02 +02:00
832a975c2c GPUUniformBuf: Fix debug name being shorter than release name 2020-08-30 13:11:02 +02:00
f69c7a7ff9 Cleanup: GPUContext: Remove default_framebuffer_
This is now handled by FrameBuffer wrapping.
2020-08-30 13:11:02 +02:00
807817c0c4 GPUFrameBuffer: Use debug name support
This is to make it easier to navigate captures in renderdoc.
2020-08-30 13:11:02 +02:00
f3a65a1b4a GPUFrameBuffer: GL backend isolation
This is related to the Vulkan port T68990.

This is a full cleanup of the Framebuffer module and a separation
of OpenGL related functions.

There is some changes with how the default framebuffers are handled.
Now the default framebuffers are individually wrapped inside special
GLFrameBuffers. This make it easier to keep track of the currently bound
framebuffer state and have some specificity for operations on these
framebuffers.

Another change is dropping the optimisation of only configuring the
changed attachements during framebuffers update. This does not give
any benefits and add some complexity to the code. This might be brought
back if it has a performance impact on some systems.

This also adds support for naming framebuffers but it is currently not
used.
2020-08-30 13:11:02 +02:00
0850afb34e Cleanup: GPU: Remove unused init/exit functions 2020-08-30 13:11:02 +02:00
6e901fd8fc GPUFramebuffer: Make GPUFrameBuffer an opaque type
This is in preparation of the Framebuffer GL backend.

This is a just changing types and moving some code.
No logic is changed... almost... it just removes the context attach.
i.e: `gpu_context_add/remove_framebuffer()`
This is not needed for now and was even disabled in release.

This is part of T68990.
2020-08-30 13:11:02 +02:00
ed7dbaa5a7 GPUState: Fix missing writemask encapsulation
This was the last remaining.
2020-08-30 13:11:02 +02:00
b1b1be1754 Object: support multiple objects for limit-total vertex groups
Also add this to the "Clean Up" menu.
2020-08-30 18:53:24 +10:00
12bc34b0b8 Object: add ED_object_array_in_mode_or_selected
Use this utility function for render-shading & weight paint modes.

This adds support for edit-mode & pose-mode where all objects in the
mode are used in this case instead of the selected objects.
2020-08-30 18:53:19 +10:00
1a623c183f UI: add "Object -> Clean Up" menu
Useful to perform cleanup operations on many objects at once,
also these operations weren't accessible from the search menu.

This follows the convention for other clean up menus
when editing mesh, curve & grease-pencil.

Resolves issues raised in T80011
2020-08-30 13:48:35 +10:00
530ccde909 Object: support removing unused weights for selected objects
This is useful to run in object-mode, instead of from the property editor,
note that this still only used the current object when activated from
the property editor.
2020-08-30 13:48:35 +10:00
1a650fdcb2 Object: support removing unused material slots for selected objects
This is useful to run in object-mode, instead of from the property editor,
note that this still only used the current object when activated from
the property editor.
2020-08-30 13:48:30 +10:00
47908f0155 Operator: expose ED_operator_object_active_local_editable_ex
Support calling this function with an object argument,
useful for implementing filter functions that loop over objects.
2020-08-30 13:42:28 +10:00
2778937fb6 BKE_layer: add BKE_view_layer_array_selected_objects_params
Useful for similar situations as BKE_view_layer_array_from_bases_in_mode_params
without depending on the active objects mode.
2020-08-30 13:42:28 +10:00
e06050945e Cleanup: pass v3d as const to view layer utilities 2020-08-30 13:42:28 +10:00
3abbae2d7c UI: Use term "Plasticity" instead of "Plastic" 2020-08-29 23:30:53 -04:00
3789aa8506 New Boolean: performance improvement.
Avoided cost of searching for coplanar clusters in many cases.
2020-08-29 17:48:01 -04:00
d8585e184a New boolean: fixed a bug in coplanar intersect.
The code that found coplanar clusters was not updating a bounding box.
Also, code that was detecting non-trivial coplanar intersects was
slightly wrong, but that would not have caused any functional problems.
2020-08-29 11:31:47 -04:00
014276a11c Cleanup: spelling 2020-08-29 18:56:08 +10:00
bfa78aceed Cleanup: remove paranoid 'MDeformVert.totweight < 0' check
This was added in 1cb7267a9f, however the behavior before this
would have failed on negative values already.

Also negative values here would fail in many other places.
2020-08-29 10:48:33 +10:00
141a3e6d47 Boolean Modifier: Reorder properties
Properties that display conditionally depending on other properties
should generally be lower down so the movement of buttons as
settings are tweaked is less intrusive.
2020-08-28 16:41:13 -05:00
f34653e498 Clang Tidy: Fix readability-delete-null-pointer warning 2020-08-28 16:20:25 -05:00
5c5d43fd66 Clang Tidy: Fix no lint marker placement
There was a line between the NOLINTNEXTLINE marker and the function.
2020-08-28 16:12:47 -05:00
91bbf96c1d Revert "tmp"
This reverts commit b78a439e90.

This was committed by mistake, and including BLI_winstuff.h on non-windows
platforms results in an error.
2020-08-28 15:29:10 -05:00
pembem22
d8283a1f89 UI: Improve curve grid drawing code
This patch fixes assert on grid drawing. `for` loops are used instead
of `while` loops to make sure the number of lines is exact. The old
code draws lots of unnecessary lines offscreen. This bug is fixed as
well. See the patch for a comparison without a scissor test.

Differential Revision: https://developer.blender.org/D8745
2020-08-28 15:22:36 -05:00
744eb1172e Fix T80195: crash when invoking tooltips on MacOS
Problem introduced in rBadd48c007428.
`UI_but_string_info_get` can change the value of the args.
2020-08-28 17:09:19 -03:00
b78a439e90 tmp 2020-08-28 17:09:19 -03:00
8f5b9fb519 Fix for T75369: Text Editor Line Color
Use correct text color when syntax highlighting is off but line numbers are on.

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

Reviewed by Hans Goudey
2020-08-28 09:58:48 -07:00
c0eb6faa47 UI: Do Not Display Negative Zero Floats
Display negative zero floats as regular zero. Does not alter underlying value.

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

Reviewed by Brecht Van Lommel
2020-08-28 09:30:51 -07:00
285353c252 Cleanup: clang-format 2020-08-28 10:04:26 -06:00
79e82dbc05 cleanup: Fix style issue in sculpt.c
At first sight this code should not build at all
but due to the use of macro's that look like functions
this seemingly has no issues building.

Clang-format alerted me to this strange bit of code
by placing the `if` on it's own line for some reason.

added the missing brackets, and clang-format is happy
again.
2020-08-28 10:03:52 -06:00
7844486e47 Change cmake configs for full and release to enable WITH_GMP. 2020-08-28 11:49:10 -04:00
1cb7267a9f Cleanup: Fix build error with msvc
`ssize_t` is not a standardized type (it's a posix type)
given the line in question here is calculating the size
of a memory allocation there's no logical way this
should ever be negative.

I do not know this code too well and was unsure if
`mdverts->totweight` could ever be < 0, so I protected
it with a clamp, just in case.
2020-08-28 09:47:52 -06:00
4749bd2277 Fix to previous commit to allow building without WITH_GMP. 2020-08-28 11:43:56 -04:00
9e09b5c418 Merge newboolean branch into master.
This is for design task T67744, Boolean Redesign.
It adds a choice of solver to the Boolean modifier and the
Intersect (Boolean) and Intersect (Knife) tools.
The 'Fast' choice is the current Bmesh boolean.
The new 'Exact' choice is a more advanced algorithm that supports
overlapping geometry and uses more robust calculations, but is
slower than the Fast choice.
The default with this commit is set to 'Exact'. We can decide before
the 2.91 release whether or not this is the right choice, but this
choice now will get us more testing and feedback on the new code.
2020-08-28 11:01:06 -04:00
4a17508c6d Merge branch 'blender-v2.90-release' into master 2020-08-28 16:58:40 +02:00
62e2d92aed Blenloader: add api function for accessing packedfile address map
This is needed to move direct_link_packedfile out of readfile.c for T76372.
2020-08-28 16:57:34 +02:00
ddbf41d88d Fix T80104: Crash on making material local.
Problem is again with the embedded data, we want to make those local
together with their owner ID, but sometimes we are actually dealing with
copies here, which are inheritently already local.

Code did not considered that possibility before, leading to access to a
NULL `lib` pointer.

This should also be back-ported to 2.83 LTS release.

Maniphest Tasks: T80104

Differential Revision: https://developer.blender.org/D8731
2020-08-28 16:51:16 +02:00
5086bdfe0b Fix T80064: Adding mask curve points doesn't work around endpoints 2020-08-28 11:50:21 -03:00
368f8f7404 Blenloader: new api function to check if reading is for undo 2020-08-28 16:29:55 +02:00
7b2fe4c9ec Refactor: move Lattice .blend I/O to IDTypeInfo callbacks 2020-08-28 16:10:17 +02:00
8815996418 Refactor: move Mesh .blend I/O to IDTypeInfo callbacks
I'm also adding `BKE_id_blend_write`, so that it can be accessed
outside of `readfile.c`.
2020-08-28 15:49:14 +02:00
5db5ac611a GPU: Fix Segmentation Fault Freeing Failed Shader
The CPP Shader class does not initialize the interface attribute.
What will crash when deleting the shader.

Reviewed By: Clément Foucault

Differential Revision: https://developer.blender.org/D8740
2020-08-28 15:45:07 +02:00
b8f990b0b4 Revert "GPU: Fix Segmentation Fault Freeing Failed Shader"
This reverts commit c284326809.
2020-08-28 15:43:14 +02:00
0ed7aedc71 Fix building without bullet support
The new BKE_rigidbody_is_affected_by_simulation function was in side the
WITH_BULLET ifdef guard.
2020-08-28 15:28:15 +02:00
b4a608c11c Merge branch 'blender-v2.90-release' into master 2020-08-28 15:09:42 +02:00
4fdd8452a6 DNA: add pragma once to dna_type_offsets.h
Sometimes, this generated file is included more than once,
so it should have an include guard.
2020-08-28 15:05:47 +02:00
8726354d46 Fix Rigidbody depsgraph passive and constraint transform relations.
We need to have transforms from passive objects if they are animated or
driven by parent relations. This is not immediately obvious as the
object transform matrix will still be available, it is just one frame
behind in some cases.

Fixed dependency cycles if there is a constraint between two rigid
bodies. Because bullet keeps track of its simulated bodies, we do not
need to supply objects transforms as bullet should already have them.

I need combine these two fixes because otherwise we will get depsgraph
warnings that nodes are missing that it expects to be there.

Reviewed By: Sergey, Jacques

Differential Revision: http://developer.blender.org/D8732
2020-08-28 14:55:59 +02:00
df8a63bb9c Fix T80078: Overrides: Crash with animated IK control on linked armature.
Issue was with our dear posebones again... when applying overrides we
keep the same address/pointer for the IDs themselves, (which avoids us
the need to remap their usages), but their inner data is often
re-allocated.

Therefore, we need once again to go over armature objects and invalidate
their posebone pointers.

This should also be back-ported to Blender LTS 2.83.

Maniphest Tasks: T80078

Differential Revision: https://developer.blender.org/D8734
2020-08-28 14:53:22 +02:00
Jeroen Bakker
0852ecd844 DrawEngine: Shader Test Suite
A test case that compiles all the GLSL shaders for workbench, gpencil, overlay and some
of eevee. Compilation is still platform dependent, but when run on a test-farm
with different hardware we will be able to detect GLSL compilation
errors early on.

The test will be compiled when `WITH_GTEST` and `WITH_OPENGL_DRAW_TESTS`
are On.

For eevee only the shaders inside eevee_shaders.c are included. EEVEE has some shaders
located inside the submodule. They aren't accessible to the outside and aren't added
to the test case. We should see how we want to add them. For the test cases it is better
to move them to eevee_shaders.c, but for eevee perspective it is better to keep them in
the submodule. Keeping them in the submodule could lead to situations that is harder to test.
as the shader could already have been initialized.

Reviewed By: Clément Foucault

Differential Revision: https://developer.blender.org/D8667
2020-08-28 14:47:27 +02:00
Jeroen Bakker
2654e9c9c1 Fix T80141: Fix Compiling Workbench Volume Shaders (Mesa 20.0.8)
Default mesa driver for ubuntu 20.04 fails when a name is defined twice.
M_PI is defined in both `common_workbench_lib` and `common_math_lib`. This patch
remove the define out of common_workbench_lib

For reference it fails on https://github.com/mesa3d/mesa/blob/mesa-20.0.8/src/compiler/glsl/glcpp/glcpp-parse.y#L1186
during the check if the macros are the same.

Reviewed By: Clément Foucault

Differential Revision: https://developer.blender.org/D8741
2020-08-28 14:41:41 +02:00
Jeroen Bakker
922aac999d Fix T79920: Fix Compiling EEVEE Volume Shaders
There were some missing UBO bindings, what asserted in debug mode.
This patch fixes this by binding the missing UBO's

Reviewed By: Clément Foucault

Differential Revision: https://developer.blender.org/D8742
2020-08-28 14:40:06 +02:00
Jeroen Bakker
3198fec1fe Fix T80160: Workbench shadows are broken
In recent refactoring {a9f2ebb21508} an issue was introduced that the
opengl rasterizer would be disabled when only writing to a stencil
buffer.

This fix adds stencil writing to the write mask and set it. This makes
the write map not evaluate to GPU_WRITE_NONE and the rasterizer will be
enabled in `GLStateManager::set_write_mask`.

Reviewed By: Clément Foucault

Differential Revision: https://developer.blender.org/D8743
2020-08-28 14:38:33 +02:00
df8e2c76c9 Merge branch 'blender-v2.90-release' 2020-08-28 14:35:04 +02:00
Jeroen Bakker
c284326809 GPU: Fix Segmentation Fault Freeing Failed Shader
The CPP Shader class does not initialize the interface attribute.
What will crash when deleting the shader.

Reviewed By: Clément Foucault

Differential Revision: https://developer.blender.org/D8740
2020-08-28 14:32:29 +02:00
a48d78ce07 Refactor: move CustomData .blend I/O to blenkernel
This is part of T76372.
2020-08-28 14:30:45 +02:00
3dc222ea7b Refactor: move defvert .blend IO to blenkernel
This is part of T76372.
2020-08-28 14:30:45 +02:00
65dcf812a5 Fix T80182: Curve [Edit Mode] : Can't Deselect Control Point with Select Box
Caused by rB49f59092e7c8: Curves: Implement Handles for selected points
only

Changes from deselecting all were not considered as changes anymore.

Maniphest Tasks: T80182

Differential Revision: https://developer.blender.org/D8744
2020-08-28 14:28:57 +02:00
2bb60db94a Merge branch 'blender-v2.90-release' 2020-08-28 14:00:51 +02:00
0e021414fe Cleanup: improve function names
With this change, the three .blend read operations: data reading, lib reading
and expanding are more grouped together.
2020-08-28 13:18:24 +02:00
a443287908 IDTypeInfo: add .blend file io callbacks
This is part of T76372.
It adds the `blend_write`, `blend_read_data`, `blend_read_lib`
and `blend_read_expand` which correspond to the various
steps when reading and writing .blend files.
Having these callbacks allows us to decentralize the blenloader
code a lot more. This has the affect that code related to any
specific ID type is less scattered.

Reviewers: mont29

Differential Revision: https://developer.blender.org/D8670
2020-08-28 13:05:48 +02:00
d3f2037966 Fix T80149: Cycles OpenCL baking broken after changes to uses tiles for baking
We forgot to update this code as part of D3108. I'd like to include this in 2.90,
it's entirely broken now so can't really get any worse.

Differential Revision: https://developer.blender.org/D8738
2020-08-28 12:53:50 +02:00
346023b457 Cleanup 'make vertex parent' operator code.
More localized variables, avoid ugly 'offset by one' index usage in
favor of explicit `INDEX_UNSET` define, etc.

No behavior change expected from this commit.
2020-08-28 11:08:03 +02:00
94d6b54826 Merge branch 'blender-v2.90-release' into master 2020-08-28 14:37:05 +10:00
1725e46cee Fix T80135: Duplicate doesn't preserve active spline
Checks to preserve the active spline on duplication
required an active vertex too.

Now having no active vertex doesn't prevent duplicate
from keeping the spline active.

Reviewed by: @mano-wii

Ref D8729
2020-08-28 14:35:30 +10:00
bc2830a3ce Cleanup: use doxy sections in interface_panels.c 2020-08-28 14:25:23 +10:00
84ae44138d Cleanup: spelling 2020-08-28 14:25:19 +10:00
5ee60c9815 Fix (unreported): Walk expansion on scene collection
Left walk navigation while the scene collection is active would collapse
the subtree which shouldn't be allowed. This adds another check to
`outliner_item_openclose` to prevent collapsing the scene collection.

Introduced in rBb077de086e14.
2020-08-27 18:49:47 -06:00
e726ed3c6b Fix: Outliner walk navigation in Data API mode
Because the subtrees in Data API mode are empty for performance reasons,
it was impossible to move through the tree with walk navigation. This
adds an exception to allow walk navigation to expand subtrees in that
mode.
2020-08-27 18:25:51 -06:00
2a0e996d77 Fix T80159: Custom Normals Averaging crash after clearing
custom split normals data

Clearing custom split normals would get rid of the CD_CUSTOMLOOPNORMAL
layer - but editing data `lnor_spacearr` would be kept.

Adding a CD_CUSTOMLOOPNORMAL layer (if none exists yet) should be done
in `edbm_average_normals_exec` / `BKE_editmesh_lnorspace_update` /
`BM_lnorspace_update` / `BM_lnorspacearr_store`. The thing is that if
the editing data `lnor_spacearr` would still be valid after `Clear
Custom Split Normals Data`, blender would happily call
`BM_lnorspace_rebuild` instead. Doing that without a CD_CUSTOMLOOPNORMAL
layer is asking for trouble.

Now clear lnor_spacearr on `Clear Custom Split Normals Data` as well.

Thx @mont29 for feedback here.

Maniphest Tasks: T80159

Differential Revision: https://developer.blender.org/D8730
2020-08-27 22:12:12 +02:00
770cc66f75 UI: Avoid redundant loops in region panel handler
Currently the panel handler loops through every block and every button
for every single panel. This commit moves that check to happen a single
time at the beginning.
2020-08-27 14:36:01 -05:00
a8766de5d5 Fix T68317: Panel "A" key doesn't collapse subpanels properly
We need to only collapse or expand the first panel under the cursor
rather than all of them. Note that whether the parent panel or
the subpanel is first depends on the order of the uiBlocks in the
region's list.
2020-08-27 14:22:28 -05:00
714dbf273c Clang Tidy: Fix warning
Fix readability-static-definition-in-anonymous-namespace in new code
2020-08-27 14:18:06 -05:00
f1565e7f73 UI: Cleanup / refactor region panel event handling
The code for handling panel events was much more complicated than it
needed to be. This commit removes some unecessary function calls and
variables, reduces indentation levels by returning early, and does
some other general cleanup.
2020-08-27 14:02:14 -05:00
0649ed7fa2 GPencil: Don't convert color to sRGB
The color is linear, so the conversion is breaking the real color.
2020-08-27 20:13:51 +02:00
e74a24f0bb Fix T77382: zooming into adjust last operation panel clips contents
This panel should not have zoom functionality at all, just like headers and
many other regions don't have it either.
2020-08-27 19:52:56 +02:00
9d6789115a Cleanup: Move panel category drawing to proper section
Somehow the panel category drawing functions ended up in the middle
of the region event handling code. This commit moves them to their
own section next to the rest of the drawing code.
2020-08-27 12:33:27 -05:00
eed8ea1b73 Cleanup: Fix white space in versions.cmake 2020-08-27 11:03:31 -06:00
9b0ef34534 Fix Outliner allowing to enter Pose Mode on linked armature
If a different object was active, clicking on a linked armature's pose
in the Outliner would enter Pose Mode for it.
This would actually cause a failed assert, but in release builds the
armature would just enter pose mode.

Steps to reproduce were:
* Link in armature object
* Activate a different object
* In the Outliner, un-collapse the armature object
* Activate Pose Mode by clicking on its pose there
2020-08-27 16:40:56 +02:00
8a984ddd0f Cleanup: Fix build warning on windows
MSBuild on windows currently spews a warning about
buildinfo.h_fake not being generated.

For build info we use a non existing file to trigger a
custom_command on every build, which has worked well for
years now, however in recent versions of MSBuild it has
started issuing warnings about files that should be
generated but are not.

CMake is actually aware of this being a problem and states
in the documentation that "If the output of the custom command
is not actually created as a file on disk it should be marked
with the SYMBOLIC source file property."

This change fixes the build warning by properly marking the
buildinfo.h_fake as symbolic resolving the warning.
2020-08-27 08:10:37 -06:00
e51c721315 Fix crash of alembic tests after recent depsgraph builder change
Need to make sure node factories are initialized prior to the dependency
graph allocation.

The regression was initially introduced in 5b021dff41

Thanks Brecht for testing!
2020-08-27 14:52:58 +02:00
1131328aeb Fix: Mantaflow always builds openvdb statically
This would lead to problems when we build a dynamic openvdb library.
2020-08-27 14:49:34 +02:00
91aeb452ab Fix: FindEmbree.cmake looking for non existing dynamic libraries and failing
It is now possible to build against a shared embree library.
Before it was only possible to build against static Embree libraries.

Reviewed By: Brecht

Differential Revision: http://developer.blender.org/D8702
2020-08-27 11:55:40 +02:00
54b47da565 Cleanup: clang-format 2020-08-27 15:33:33 +10:00
8b82693898 MSVC: Set proper flags for C++17 support.
MSVC already builds with the /std:c++17 flag but for
'reasons' [1] MSVC still gives the wrong value for the
__cplusplus define.

This change sets an additional cxx flag on supported
compilers to allow the compiler properly identify
C++17 support.

This resolves 2 warnings coming out of bullet about
the register keyword being deprecated.

[1] https://devblogs.microsoft.com/cppblog/msvc-now-correctly-reports-__cplusplus/
2020-08-26 22:25:40 -06:00
bbf00a6231 Cleanup: Fix build warning with MSVC and OSL
OSL requires RTTI to be off, this is done with the /GR- flag for
MSVC, however /GR is in the default CXX flags leading to warning

D9025 : overriding '/GR' with '/GR-'

which cannot be suppressed.

/GR is on by default and this flag is not required, so removing
it from the default CXX flags makes it possible later use /GR-
without generating warnings.
2020-08-26 22:20:34 -06:00
7f3febf4c0 Fix (unreported): Outliner Data API tree subtree expansion
The changes in rB70151e41dc02 broke subtree expansion in the Data API
display mode because the closed subtrees are empty lists. Move the empty
subtree check from `outliner_item_openclose` to the walk navigation
code to prevent the issue.
2020-08-26 21:29:45 -06:00
489b5790cf Cleanup: Fix build warning with MSVC
`IDTypeForeachCacheFunctionCallback` lists the `flags` parameter
as `uint`, having these functions use `eIDTypeInfoCacheCallbackFlags`
results in the following warning when building with MSVC:

warning C4028: formal parameter 4 different from declaration

This change resolves this warning by changing the parameter to
the appropriate type.
2020-08-26 19:14:17 -06:00
6438fc4f79 Cleanup: Fix MSVC warning in mantaflow
This resolves the following MSVC warning:

warning C4805: '&=': unsafe mix of type 'int' and type 'bool' in operation
2020-08-26 19:07:24 -06:00
Red Mser
479ce00809 UI: Use alternating row theme color in file browser
The outliner already uses the alternating row theme color as an
overlay for every other row. This uses the same color for the file
browser, instead of a hardcoded shading.

The file browser background color is slightly tweaked to match the
outliner, and the Blender Light theme is updated to use a lighter
background color like the outliner.

Reviewed by: Hans Goudey, Julian Eisel

Differential Revision: https://developer.blender.org/D8717
2020-08-26 16:53:58 -05:00
8a9912eaf8 Tests: fail automated tests on memory leaks and other internal errors
This adds a new `--debug-exit-on-error` flag. When it is set, Blender
will abort with a non-zero exit code when there are internal errors.
Currently, "internal errors" includes memory leaks detected by
guardedalloc and error/fatal log entries in clog.

The new flag is passed to Blender in various places where automated
tests are run. Furthermore, the `--debug-memory` flag is used in tests,
because that makes the verbose output more useful, when dealing
with memory leaks.

Reviewers: brecht, sergey

Differential Revision: https://developer.blender.org/D8665
2020-08-26 22:02:02 +02:00
d8cf6ee316 install_deps: add fontconfig to installed libs/tools. 2020-08-26 20:44:53 +02:00
f807b27b67 Cleanup: Fix const warning with BLI_array_free
when you call the BLI_array_free macro with a const pointer you get a
warning when the macro calls `MEM_freeN` (warning C4090: 'function':
different 'const' qualifiers)

This was warning originating from
`smart_uv_project_calculate_project_normals` in `uvedit_unwrap_ops.c`

Normally we resolve these with a non const cast at the callsite
but given BLI_array_free is a macro not a function this is not
an option here and it has to be resolved in the macro.
2020-08-26 11:42:40 -06:00
0498feb0df Fix T80129: Cycles shadow catcher viewport error with exposure other than 1 2020-08-26 19:26:38 +02:00
bd678918ae Fix T80080: improve tooltip for render number of threads
Since the switch to TBB, the threads value specificies the maximum number of
CPU cores used while rendering, it is not longer possible to use more threads
than cores. Change the tooltip to make this more clear.
2020-08-26 19:26:38 +02:00
f699ba3d30 Cleanup: better naming and no bad level access in BLI_winstuff 2020-08-26 19:26:38 +02:00
9de18c361b Outliner: Use shift for restrict button child toggle
The `ctrl` key was mapped to recursive bone selectable and visibility
toggling. This changes the key to `shift` to be consistent with objects
and collections. Also adds an explanation to the tooltip.

Part of T77408

Differential Revision: https://developer.blender.org/D8650
2020-08-26 11:19:19 -06:00
70151e41dc Outliner: Left and right walk navigation
Previously the left and right arrow keys would close and open the active
tree element, but a subsequent key press would not select up or
down the tree as is common in tree-based interfaces.

Walking left and right now does a selection action after opening or closing
the active tree item. For example, a right key press on a closed element
will open it's subtree, and an additional right key press will select
the first child element.

A left key press anywhere in a subtree will first close the active
element if it's subtree is expanded. Walking left again will select the
parent element.

Part of T77408

Differential Revision: https://developer.blender.org/D8650
2020-08-26 10:58:23 -06:00
b028a43245 Cleanup:Remove C++14 flags from extern/quadriflow
The main CMakeLists.txt specifies C++17, quadriflow tries to add C++14
flags leading to the following warnings when building with MSVC

Command line warning D9025 : overriding '/std:c++17' with '/std:c++14`

This change removes the C++14 flags, and fixes a build error caused
by the removal of `std::unary_function` in C++17 in the .obj loader
(which isn't used by blender)

Reviewed By: zeddb

Differential Revision: https://developer.blender.org/D8720
2020-08-26 10:04:24 -06:00
3185e17844 Logging: change error to warning
This is in preparation for https://developer.blender.org/D8665.
2020-08-26 17:48:20 +02:00
14608c5e86 Cleanup: Fix MSVC warning regarding flags in bullet
For bullet we compile at /W0 for MSVC but we did not
remove the standard /W3 flag. Leading to the following
warning:

Command line warning D9025 : overriding '/W3' with '/W0'

This change removes the W3 flag for bullet to get rid
of the warning.
2020-08-26 09:16:21 -06:00
Yevgeny Makarov
2ef5fabec9 Fix T77900: File Browser in macOS fullscreen crashes
When Blender is started in fullscreen mode from the command line,
or if the fullscreen state is saved in the startup file, all temporary windows
will also open in fullscreen mode. When closing the fullscreen File Browser,
Blender would either crash or parent window becomes black.

This does not happen if the Blender switches to full screen manually.

`NSWindowCollectionBehaviorFullScreenPrimary` should be set for windows that
can enter full-screen mode. Otherwise macOS will turn the wrong window into
full-screen.

Similar fix: rB4b39de677d20

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

Reviewed by: Julian Eisel
2020-08-26 16:27:05 +02:00
239b0ba750 Clenaup: Refactor Sculpt gesture mask operators
This refactors Box Mask and Lasso mask making both functions share the
same code. After this change it should be easier to add new
functionality, new gesture tools or implement new gesture modes.

No functional changes.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D8707
2020-08-26 15:44:54 +02:00
08ec9b71df Merge branch 'blender-v2.90-release' into master 2020-08-26 23:28:44 +10:00
e0772c6607 Fix T80098: Mesh deform doesn't update in edit mode
Use BKE_mesh_wrapper API access to access mesh coordinates
for modifier evaluation.

Call BKE_mesh_wrapper_ensure_mdata when binding
since it's a one off operation.

Regression from deaff945d0.

Reviewed by: @brecht

Ref D8709
2020-08-26 23:20:37 +10:00
826bd46e66 GPencil: Hide Boundary strokes in Render
This change hides the boundary strokes used for closing filled areas in render mode (viewport and final render).

Related to T80128
2020-08-26 15:05:54 +02:00
d4f7c7f4cc GPencil: Fix Assert using fill tool
With the new changes in the Draw Manager, GPU_depth_mask must be set to ON, before clear depth.
2020-08-26 13:32:57 +02:00
a7e1963b63 Cleanup: remove G.debug_value check for old mesh-deform behavior
Added in 2007, it doesn't seem useful to support alternate behavior.
2020-08-26 21:04:00 +10:00
7773663eb7 Cleanup: remove unused UvVertMap.flag 2020-08-26 21:01:28 +10:00
70d48255ae Fix T79992: Error calling context.copy() in Properties Editor
This was an oversight in rB83e3d25bcae3.

Basically we still have the "hair" and "point_cloud" entries for the
context. However they were ifdef'ed.

Note this would mostly happen in 2.90 since we always build without hair
and particles there.

Differential Revision: https://developer.blender.org/D8712
2020-08-26 11:34:12 +02:00
e414afbaf6 Cleanup: typos 2020-08-26 11:24:10 +02:00
c44251c7d7 Merge remote-tracking branch 'origin/blender-v2.90-release' 2020-08-26 11:18:41 +02:00
Evan Wilson
8ddf8cfa6f Fix #ifdef WITH_PARTICLE_NODES and WITH_HAIR_NODES mixup in rna_internal.h
Differential Revision: https://developer.blender.org/D8711
2020-08-26 11:16:48 +02:00
0e50b6529c BLI: support removing multiple elements from a vector 2020-08-26 10:52:43 +02:00
6a10e69d27 UV: match 3D mesh editing behavior for edge-loop select
- Cycling between part of the boundary & the entire UV boundary.
- Include pole vertices in the selection.

Edge loop selection was rewritten to use BMesh connectivity data.
2020-08-26 18:39:25 +10:00
8f545375f9 Cleanup: simplify edge loop/boundary select cycling logic 2020-08-26 16:56:24 +10:00
7fb11f22a2 Docs: comments for interface_handlers.c
Explain why some features have defines,
also use doxy sections for defines & prototypes.
2020-08-26 10:31:50 +10:00
add48c0074 Cleanup: use const variables in interface code 2020-08-26 10:31:44 +10:00
88ada5e218 Cleanup: add SEQ_ALL_BEGIN, SEQ_CURRENT_BEGIN to .clang-format
These were missed in 70500121b4 which caused reformatting.
2020-08-26 09:59:15 +10:00
be4abb42c1 Cleanup: spelling 2020-08-26 09:41:30 +10:00
bbb6ec9e51 Cleanup: build without USE_KEYNAV_LIMIT defined 2020-08-26 09:41:09 +10:00
396d39c6b9 Cleanup: Declare variables where they are initialized
Further changes to interface_handlers.c to avoid a block of variable
declarations at the beginning of functions. Also use const in some
situations. I only made changes where the variable's intended scope
was obvious.
2020-08-25 14:28:04 -05:00
Valentin
6e06936c0e Cleanup in interface_handlers.c
- Reduce variables scope
 - Use some const prefixes
 - Initialize variables at declaration
 - Use comparison to boolean false instead of 0

Differential Revision: https://developer.blender.org/D8678
2020-08-25 13:15:57 -05:00
72bcb900d0 install_deps: also clear BLOSC cmake variables.
Otherwise when switching from self-built to distro packages for OpenVDB,
Blosc CMake cached variables break building...
2020-08-25 19:54:22 +02:00
999667a8c5 Fix T79494 Refrence Image reflects object after source got deleted
Silly typo was causing the error texture to not be bound.
2020-08-25 19:25:39 +02:00
97f75ca87f GPUState: Move state limits getter to the area they belong
This fix a GL_INVALID_VALUE error on startup due to 0.0f max line width.

Also moves the max anisotropy filter to the sampler creation.

This reduces code fragmentation.
2020-08-25 18:18:55 +02:00
2c34e09b08 Outliner: Include gpencil modifiers and effects in the tree
Grease pencil modifiers already had defined outliner icons, but had
never been included in the tree. This adds the modifiers and the shader
effects to the tree.

Part of T68498
2020-08-25 10:04:15 -06:00
21cb6f09ff Fix T77298: Cycles multiple object making not working with multiple samples
The previous fix loaded the pixels so existing tiles were not overwritten.
However the Cycles render buffer is expected to be scaled by the number of
sample, which was not taken into account.

This is not ideal in that previews could have a mismatched number of samples
between multiple objects, though the result will be correct. The better solution
would be to bake all objects together per tile, rather than one after the other.
But that is a bigger change than we can do in 2.90.

Differential Revision: https://developer.blender.org/D8704
2020-08-25 18:00:35 +02:00
949d92ad5d Fix T79811 MacOS: Edit Mode - vertex/edge/face selection is missing
The VAO reconfiguration from the offset workaround was not working.
2020-08-25 17:42:07 +02:00
b2b4f9fc9b Fix buildbot failing due to non-existent git submodule hash
The wrong hash was committed in 95cc709612, presumably due to local changes
to the submodule repository.
2020-08-25 16:13:58 +02:00
c336947dbb Merge branch 'blender-v2.90-release' into master 2020-08-25 23:56:34 +10:00
33ac3582bb Fix T77359: Crash adding UV's in edit-mode with linked duplicates
This prevents UV layer mix up in
MeshBatchCache.cd_used/cd_needed/cd_used_over_time which depends on the
extraction method.

One object's mesh can be accessed with MR_EXTRACT_MESH, another object
that uses the same mesh can use MR_EXTRACT_BMESH based on
(Object.mode & OB_MODE_EDIT), this causes a problem as the edit-mesh
and the mesh aren't always in sync, the custom data layers wont
necessarily match up, causing T77359.

Reviewed by @jbakker, @brecht

Ref D8645
2020-08-25 23:54:26 +10:00
9dd4d87f18 GPU: Fix compilation issue caused by rBb43f4fda19b9 2020-08-25 15:16:06 +02:00
b43f4fda19 GL: Add error checking function
This is to ease the debugging process on Apple GL implementation.
2020-08-25 15:02:34 +02:00
e51c428be6 GPUSelect: Avoid assert caused by clearing without a depth mask
This should not cause any problem since the depth test is required
in order to draw to the depth buffer and this is not altered by
this change.

To be on the safe side, we still restor the mask after altering it.
2020-08-25 15:02:34 +02:00
5f86a10477 Fix T80012: Bevel Shader node Samples value has too low hardcoded limit
Up the hard limit, keep the UI range max at 16

Maniphest Tasks: T80012

Differential Revision: https://developer.blender.org/D8701
2020-08-25 12:34:10 +02:00
8657c6cb71 Merge branch 'blender-v2.90-release' 2020-08-25 12:17:49 +02:00
Red Mser
3ea324488a Fix T80016: Shape key animation is linked when duplicating object
Fix T80016

Caused by a typo in rB7b1c406b5431ce65d84ddb5f2c53977c25c18373

Reviewed By: mont29, dfelinto

Maniphest Tasks: T80016

Differential Revision: https://developer.blender.org/D8693
2020-08-25 12:11:59 +02:00
ac8825621f Merge branch 'blender-v2.90-release' 2020-08-25 11:56:27 +02:00
263cf2ea94 Enabled workaround to solve threading issues in draw manager
This workaround addresses T79533 and T79038 for Blender 2.90. The
solution isn't clear and needs more research and work. In order to
continue with blender 2.90 release it was proposed to add this work
around.

It has been tested with the test files provided in the reports.

Reviewed By: Dalai Felinto, Clément Foucault

Differential Revision: https://developer.blender.org/D8695
2020-08-25 11:48:48 +02:00
024a9d17d2 Revert "Enabled workaround to solve threading issues in draw manager"
This reverts commit 141a8ff6b3.
2020-08-25 11:29:20 +02:00
8bb93ca80a Fix T79915: crash when changing to white noise texture
Reviewers: brecht, OmarSquircleArt

Differential Revision: https://developer.blender.org/D8697
2020-08-25 11:23:35 +02:00
Jeroen Bakker
141a8ff6b3 Enabled workaround to solve threading issues in draw manager
This workaround addresses T79533 and T79038 for Blender 2.90. The
solution isn't clear and needs more research and work. In order to
continue with blender 2.90 release it was proposed to add this work
around.

It has been tested with the test files provided in the reports.

Reviewed By: Dalai Felinto, Clément Foucault

Differential Revision: https://developer.blender.org/D8695
2020-08-25 08:18:25 +02:00
189ba40e9b Cleanup: use doxy sections 2020-08-25 15:10:36 +10:00
5eb7aa5ebb Fix T80077: Objects disappear when joining with a zero scaled axis
Use invert_m4_m4_safe_ortho when joining objects so zero scaled axis
doesn't cause all points to be scaled to zero.

Instead geometry is left un-scaled on degenerate axes.

Report a warning in this case since users may want to adjust the
active objects scale.
2020-08-25 14:32:10 +10:00
96401e2ef8 BLI_math_matrix: add invert_m4_m4_safe_ortho (m3 version too)
Unlike invert_m4_m4_safe, this calculates zeroed axes.
Useful when we need to use the inverse of an objects matrix,
keeping the valid axis, only filling in the zeroed ones.
2020-08-25 12:57:56 +10:00
46eca3366e Sculpt: Cloth Snake Hook Brush
This implements Snake Hook as a deform type for the cloth brush. This
brush changes the strength of the deformation constraints per brush step
to avoid affecting the results of the simulation as much as possible. It
allows to grab the cloth without producing any artifacts in the surface
and create more natural looking folds than any of the other deformation
modes.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D8621
2020-08-24 23:28:01 +02:00
5a634735e6 Fix T80008: Smooth brush not deforming mesh boundaries correctly
In 2.83 and previous versions there was a bug that was causing boundary
vertices to be detected incorrectly that was preventing the smooth brush
to work on boundaries if there was a pole on them.
In 2.90 the boundary vertex detection was fixed, but it was still using a
simplified version of the algorithm without any boundary smoothing. This
patch implements a similar smoothing algorithm to what I think it was
the intention of 2.83 and previous versions, but working correctly.

Reviewed By: sergey

Maniphest Tasks: T80008

Differential Revision: https://developer.blender.org/D8680
2020-08-24 23:09:10 +02:00
ed4c83f61f T79811 MacOS: Edit Mode - vertex/edge/face selection is missing
This is quite embarassing... it was returning the base instance instead of
the correct vao. No wonder that it was causing crash and at most drawing
issues.
2020-08-24 19:25:43 +02:00
f5ca34d0b4 BLI: simplify lookup methods in Map
No functional changes expected.
2020-08-24 19:02:41 +02:00
975fc39457 Merge branch 'blender-v2.90-release' 2020-08-24 18:28:58 +02:00
1bced5884c Fix T80039: Do not subdivide with Multires is mesh has no faces
This skips the subdivision operation if the mesh has no loops, avoiding
the crash.

Reviewed By: sergey

Maniphest Tasks: T80039

Differential Revision: https://developer.blender.org/D8696
2020-08-24 18:27:49 +02:00
dc74d60915 Fix T79819: crash with OSL trace() and getmessage() after Embree changes
The return value of scene_intersect must be checked, the isect struct members
can't be assumed to be initialized if that returns false.

Differential Revision: https://developer.blender.org/D8692
2020-08-24 17:54:25 +02:00
8e18a99845 BLI: improve exception safety of Set and Map
For more information see rB2aff45146f1464ba8899368ad004522cb6a1a98c.
2020-08-24 17:24:13 +02:00
5303509354 Fix T80076: Cycles Alembic Motion Blur Problem
The problem occurs when a deforming modifier is added to the object
after the MeshSequenceCache modifier. We should only consider the cached
velocities if the MeshSequenceCache modifier is the last one on the
object and we also need to check for the correct vertex count before
adding the motion vertex attribute.
2020-08-24 16:56:23 +02:00
734abaa252 Cycles: cleanup, remove unused parameter
This parameter was introduced during a revision of the Alembic motion
blur patch, and is not needed anymore.
2020-08-24 16:56:23 +02:00
950d857505 Merge branch 'blender-v2.90-release' 2020-08-24 10:40:12 -04:00
9498eb2692 API Docs: Update Changelog from 2.83 2020-08-24 10:38:17 -04:00
39a09b536e Workbench: Fix assert with sculpt in textured color mode 2020-08-24 16:26:29 +02:00
5b021dff41 Fix T80035: Fix crash switching/adding scenes
Ensure that time source always is in the dependency graph, allowing to
tag the graph for time update prior it was fully built.

Collaboration of Philipp Oeser, Jacques Lucke and myself.
Thanks everyone :)
2020-08-24 15:55:07 +02:00
ee2e2f14ac numaapi: Sync with upstream
Fixes potential build error in some build configurations
2020-08-24 07:45:39 -06:00
Jeroen Bakker
95cc709612 Theme: Remove TH_UV_OTHERS from bTheme
`TH_UV_OTHERS` is a theme option that isn't hooked to anything since
blender 2.80. This patch will remove the option and related code.

Reviewed By: Campbell Barton

Differential Revision: https://developer.blender.org/D8669
2020-08-24 15:19:49 +02:00
1cac6fe542 Fix selected UV vertex drawing ignoring size 2020-08-24 22:51:31 +10:00
be920fe786 UVEdit: Fix assert caused by depth mask not being set before clear
This happened when using the shading panel when a uv editor opened.
2020-08-24 14:14:17 +02:00
7ce764c9ec Fix T79896 Awful performance with Dyntopo on
Regression caused by rB9443da6166f5. Forgot to clear the flag.
2020-08-24 13:52:01 +02:00
cb8da6efce GPUState: Fix scissor state being overwritten when changing scissor bounds
Fix T79899 viewport artifacts when sculpting
2020-08-24 12:28:54 +02:00
4883cc5728 BLI: add Array.last method
This makes it consistent with Vector and Span.
2020-08-24 11:51:41 +02:00
Imre Palik
afbc727da2 Cycles: Fix missing dependencies in libcycles_device
The code uses OpenGL functionality, so is to be linked against
OpenGL libraries.

This makes it easier to integrate with cycles using CMake.

Differential Revision: https://developer.blender.org/D8371
2020-08-24 11:45:47 +02:00
6b1b2ded77 Merge branch 'blender-v2.90-release' into master
# Conflicts:
#	source/blender/editors/space_node/node_draw.c
#	source/blender/editors/space_sequencer/sequencer_draw.c
2020-08-24 11:31:06 +02:00
35ef42d967 Fix T79970 EEVEE: Camera Animation Breaks Motion Blur (Two Steps or More)
This was caused by motion blur camera movement tagging the view as
invalid and thus resetting the temporal sampling.

Critical fix for 2.90. Need second look, but quite confident. This function
is only called once when Motion blur is off.

Reviewed by: jbakker

Differential Revision: https://developer.blender.org/D8676
2020-08-24 11:24:33 +02:00
40edb84dcf Revert "Fix T77564: VSE (and compositor background) lost stereoscopy preview"
This reverts commit d5b5b228e4.
This reverts commit 47c6f41b89.
2020-08-24 11:17:52 +02:00
e4932d1167 Fix T80034 Crash using material panel on 2.91.0 alpha
This was caused by a NULL name.
2020-08-23 14:48:44 +02:00
e74ba9e09e Fix T79872: VSE - splitting strip shows the channel number when unused
This operator is dependent on mouse position (if the Use Cursor Position
option is used). The Channel property is irrelevant/unused in this case.
So it is not optimal displaying this property when calling this from the
menu (or even using the shortcut with default settings).

Now use a custom UI in the Adjust Last Operation panel in this case.
The properties are now drawn in relation to another then (Channel
underneath Use Cursor Position) next to some other minor layout
improvements.

Thx @HooglyBoogly for feedback (also providing UI code)

Maniphest Tasks: T79872

Differential Revision: https://developer.blender.org/D8625
2020-08-23 13:17:49 +02:00
833bc70399 Fix T79874: VSE - error clearing fades without animation data
Maniphest Tasks: T79874

Differential Revision: https://developer.blender.org/D8624
2020-08-23 13:09:57 +02:00
f18e537451 Cleanup: GPU: Use explicit clear value in GPU_clear* commands
This replace `GPU_clear()` by `GPU_clear_color()` and `GPU_clear_depth()`.
Since we always set the clear value before clearing, it is unecessary
to track the clear color state.
Moreover, it makes it clearer what we clear the framebuffer to.
2020-08-23 12:04:24 +02:00
846cac94db GPUFramebuffer: Use GPUState to temporary change write mask in clear fn
This avoid breaking sync of the state object. Also avoid more hazard.
2020-08-23 12:04:24 +02:00
72e78df464 GPUState: Expose Stencil mask and test
This is to be used by framebuffer clearing.
2020-08-23 12:04:24 +02:00
ed288a5786 Fix T79989: File browser Return doesn't open a directory
Regression in e4a50e3f47.
2020-08-23 16:32:33 +10:00
8f8ed8f567 Fix T80028: Crash opening a file from a timer 2020-08-23 13:44:18 +10:00
2cf930adf3 Cleanup: remove unused UvNearestHit struct members 2020-08-23 12:13:48 +10:00
010c1370af CMake: Fix policy warning about OSL_ROOT being set.
When the OSL_ROOT variable is set this is ignored
by findpackage on cmake < 3.12. CMake 3.12 and up
also  ignore it and warn about it. This change
tells cmake it is OK to use the variable and
stop warning
2020-08-22 16:24:09 -06:00
8f48a32f9f UI: In-line layout for camera passepartout
No need for a sub-panel when there is just one setting.
2020-08-22 21:53:16 +02:00
1885bf77b6 Fix T80013: Crash when toggling maximized area
Error renaming variable in 75aeb4b881
2020-08-22 11:30:51 -04:00
e26301f4d1 Fix T79971 Regression: Transform Gizmos doesnt work anymore
This changes the state of occlusion queries quite a bit. Now scissors is
explicitely disabled and we enabled color write.

I still don't understand why we now need this. This patch is just trial and
error on an affected setup. Note that on the same computer, renderdoc
was not able to capture the regression (the regression did not manifest
during capture).

Regression likely introduced by rB5f414234ddea
2020-08-22 01:42:15 +02:00
a204324966 DRW: Fix state not being locked
Regression introduced by rBe12c08e8d170b7ca40f204a5b0423c23a9fbc2c1
2020-08-22 01:42:15 +02:00
a1f54be042 Cleanup: Remove unused variables 2020-08-21 15:33:40 -04:00
53d1f89322 Fix T79987: Crash when joining objects
Mistake in b077de086e. I did the same fix for a few operators there,
but missed the object "Join" one.

The joining operator changes the layer content. So it must send a
notifier for that.
Before b077de086e that didn't cause a noticeable issue, because the
Outliner happened to listen to other notifiers (active/selection
changes) the operator sent and fully rebuilt its tree in response. Now
missing these notifiers can be more problematic, since we try to avoid
more rebuilds.

Added comments to the notifier types to avoid at least this pitfall.
2020-08-21 19:46:15 +02:00
70500121b4 Cleanup: rename iterators over sequences to be more clear about what they do.
No functional changes expected.
2020-08-21 18:55:27 +02:00
74ded456b3 Merge branch 'blender-v2.90-release' into master 2020-08-21 17:43:59 +02:00
ebf10b72b0 Fix critical bug in foreach ID looper of Scene data-block.
Since stone age of lib_query, the code would iterate over the current
list of active sequences (from a meta strip e.g.), and not over the
whole list of those.

This is a critical issue as it means in some cases (editing a meta strip
typically), some ID pointers would be missed/ignored by this foreach
looper, which is now at the center of most of our ID management code.

This caused a bug here at the studio, leading to loss of all sound IDs
used by sound strips when editing and undoing inside a meta strip, since
ID refcounting would not happen properly on strips using sounds outside
the meta-strip context during file reading of the undo steps.

To be backported to 2.83.

Differential Revision: https://developer.blender.org/D8671
2020-08-21 17:35:18 +02:00
661ba642f2 Cleanup: spelling 2020-08-22 00:10:52 +10:00
eed43a89dd Cleanup: use doxy sections for fcurve.c 2020-08-22 00:10:52 +10:00
c00707c18d Cleanup: remove f-string use 2020-08-22 00:10:52 +10:00
995725c681 Cleanup: remove duplicated code from previously unnoticed merge conflict
`BKE_animdata_blend_expand` is called in `expand_id` already.
2020-08-21 16:01:30 +02:00
0de48f8550 Refactor: move animdata code from blenloader to blenkernel 2020-08-21 15:58:28 +02:00
bed634c4f9 Refactor: move nla code from blenloader to blenkernel 2020-08-21 15:42:26 +02:00
71634d94ca Cleanup: remove LodLevel
This was part of the game engine and is not used anymore.

Reviewers: brecht

Differential Revision: https://developer.blender.org/D8666
2020-08-21 15:24:36 +02:00
79d678e677 Refactor: move fcurve/fmodifier code from blenloader to blenkernel
This is part of T76372.
2020-08-21 15:23:33 +02:00
76689e8517 Cleanup: use LISTBASE_FOREACH in readfile.c 2020-08-21 14:39:39 +02:00
2e630297af GPUShader: Fix linking working even if one shader compilation failed
Linking without valid shaders works on some drivers. Avoid this case by
forcing linking step to return false.
2020-08-21 14:25:58 +02:00
3a6e981bcd Cleanup: GPU: Update classes comments
This should avoid confusion about what is a class and what is an opaque
pointer.
2020-08-21 14:16:42 +02:00
220fbdf593 GPUShader: Make GPUShader* an opaque pointer to blender::gpu::Shader
This avoids the misleading inheritance.

Also cleanup by setting the blender::gpu::Shader as active shader to
avoid some casting.
2020-08-21 14:16:42 +02:00
1e95a7402c GPUShader: Fix NULL string used as shader name.
The shader name is required with the latest changes.
2020-08-21 14:16:42 +02:00
c4f122ac8f GPUUniformBuf: GL backend isolation
This is in preparation of vulkan backend. We move all opengl
functionnalities behind an abstract class.

This also cleansup the "dynamic" ubo create and rename it to
`GPU_uniformbuf_from_list()`

Contains, no functional change.

Part of T68990 Vulkan support.
2020-08-21 14:16:42 +02:00
7edd8a7738 GPUUniformBuf: Rename struct and change API a bit
This follows the GPU module naming of other buffers.
We pass name to distinguish each GPUUniformBuf in debug mode.
Also remove DRW_uniform_buffer interface.
2020-08-21 14:16:42 +02:00
4f0a749489 Cleanup: use LISTBASE_FOREACH in writefile.c 2020-08-21 13:14:41 +02:00
933f0caec6 Blenloader: move IDProperty read/write code to blenkernel
This is part of T76372.
2020-08-21 12:45:41 +02:00
27f0a19bdc Cleanup: remove exec() calls from custom property editor
Remove `exec()` and `eval()` calls from `WM_OT_properties_edit` where
possible. This not only results in simpler, cleaner code, but also
removes the necessity for `repr(value)` to evaluate to a Python
expression that in turn evaluates to `value` again.

No functional changes.

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D8658
2020-08-21 12:34:41 +02:00
3bc09c1c1e Cleanup: split BKE_scene_get_depsgraph() into two functions
Split the depsgraph allocation into a separate function
`BKE_scene_ensure_depsgraph()`. Parameters are only passed to those
functions that actually need them. This removes the the "if that boolean
is `false` this pointer is allowed to be `NULL`" logic and more cleanly
decouples code.

No functional changes.
2020-08-21 12:23:13 +02:00
e7767ba6be Cleanup: Reduce nesting of scene_get_depsgraph_p()
Reduce nesting by flipping conditions and returning early. It's now much
clearer that it's actually a linear function (rather than a nested one).

No functional changes.
2020-08-21 12:18:48 +02:00
7aeaf5da0e Fix crash when accessing view_layer.depsgraph through BPY
For the sanity checks to work we don't actually need to check other
scenes. So this function can be simplified so that it does not require
a `Main *`.

Mistake in 5cc08510e0.
2020-08-21 11:31:15 +02:00
41d31e100d Cleanup: remove MeshBatchCache from MeshRenderData
Was noted as a hack, this can be passed as an argument instead.
2020-08-21 17:19:25 +10:00
6755464527 UI: Fix panel collapse all behavior inverted
Ctrl click on a panel should collapse all other panels but leave that panel
expanded. In a recent cleanup commit that was mistakenly reversed.
2020-08-20 23:41:10 -04:00
4ed8bd88d9 UI: Cleanup in interface_panel.c
- Use const in some places where applicable
- Use consistent variable names in some places
- Use "r_" prefix for return arguments
- Declare variables in smaller scope where they are used
2020-08-20 23:38:39 -04:00
75aeb4b881 Cleanup: Use LISTBASE_FOREACH in editors/screen directory
Differential Revision: https://developer.blender.org/D8653
2020-08-20 20:47:44 -04:00
ce0bcd5fbf Fix incorrect notifier value
Wouldn't actually cause an issue since the value was unused within the
subtype bits.
Own mistake in dc2df8307f.
2020-08-20 20:28:54 +02:00
b077de086e Outliner: Avoid rebuilding tree on selection/active changes
We can avoid the rather expensive outliner tree rebuilds and only redraw
if nothing but the selection or active item changes. This should give a
bit of speedup for heavy scenes.

For this to work I had to correct a few notifiers, some were only
sending selection/active change notifiers that actually did things like
adding objects. I also added a more precise notifier type for when the
active collection changes. At the notifier subtype/action level we're
not even close to running out of bits, so this should be fine.
Also had to correct a wrong notifier check (was using `&` rather than
`==`).
2020-08-20 20:22:47 +02:00
2e6d5e6c6b Cleanup: Clang Tidy: Resolve readability-delete-null-pointer error 2020-08-20 13:33:17 -04:00
e5fd2a3888 Merge branch 'blender-v2.90-release' into master 2020-08-20 17:59:05 +02:00
5a957c0299 GPUShaderInterface: Fix use after free crash 2020-08-20 17:57:05 +02:00
05e1ccf108 Fix T79931: Infinite loop in scene "Full Copy" in 2.90.
Code dealing with object copy of master collection was bugy in case one
of the new object copy would get a name lesser than the original object,
leading to new copy being inserted before original one in lists.

Maniphest Tasks: T79931

Differential Revision: https://developer.blender.org/D8656
2020-08-20 17:47:56 +02:00
Wayde Moss
89ee260ef2 Fix T63675: Keying outside NLA strip not possible
Allow adding keys outside of the NLA strip, when Sync Length is
activated. Before this, an animator would have to exit tweak mode,
adjust the strip length, then enter tweak mode again.

Now the animator can freely insert and modify keys outside of the strip
bounds. They will never have to touch the strip bounds directly.

Reviewed By: sybren

Differential Revision: https://developer.blender.org/D7533
2020-08-20 17:19:36 +02:00
7d79b06fa7 Cleanup: Mesh Filter invoke refactor
This moves the allocation for filter to separate functions, removes all
repeated calls to RNA_enum_get an fixes some other code quality issues.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D8639
2020-08-20 17:03:15 +02:00
5f414234dd GPUState: Use state setters inside selection code
This fixes T79945 Gizmos don't work in Edit Mode
2020-08-20 17:02:39 +02:00
8228356f50 DRW: Fix remaining glDisable 2020-08-20 17:02:39 +02:00
e23ef8753a GPUState: Use explicit depth test enum 2020-08-20 17:02:39 +02:00
c85144934a Fix T79924: Update the view rotation origin after setting the sculpt pivot
This updates the view navigation origin after modifying the pivot
position.

Reviewed By: sergey

Maniphest Tasks: T79924

Differential Revision: https://developer.blender.org/D8632
2020-08-20 17:01:12 +02:00
d74c495838 Fix variable simulation steps with cloth deform brushes
Cloth deform brushes (both in cloth brush or other tools with cloth
simulation targets) should not have their spacing as a value relative
the brush radius to avoid affecting the simulation speed when changing
the brush radius.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D8620
2020-08-20 17:00:12 +02:00
b3bd121dd4 Sculpt: Add orientation modes to the Cloth Filter
This adds the orientation modes to the Cloth Filter.
Similar to the mesh filter, they set the orientation of the axis when
limiting the forces.

When using the gravity mesh filter, the orientation also sets the gravity
direction. In world orientation, cloth will always fall towards the
ground plane. In view mode, cloth will always fall down relative to the
view.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D8618
2020-08-20 16:58:26 +02:00
Wayde Moss
50919413fe NLA: Fix strip Sync Length moving animation data
Change the way Sync Length works so that it keeps keyframes at the same
key as before the sync. Now when the user exits tweak mode, the overall
NLA result is unchanged.

Reviewed By: sybren

Differential Revision: https://developer.blender.org/D7602
2020-08-20 16:44:38 +02:00
Red Mser
12dd08ef52 UI: Fix aligned popovers not always turning inactive
Popovers which are aligned with properties should turn themself
(and the panel they open) inactive when the corresponding property
toggle is turned off. A notable exception is the snap settings
popover, as snapping can still be used when the toggle is off.

Differential Revision: https://developer.blender.org/D8584
2020-08-20 10:34:55 -04:00
263148dbac Depsgraph: refactor tagging after time changes
This reverts {rB1693a5efe91999b60b3dc0bdff727473b3bd00bb}
and implements an alternative solution.

The old patch had the problem that the depsgraph would always
evaluate at the current frame of the original scene (even when
`DEG_evaluate_on_framechange` was used). Now it is possible
to evaluate the depsgraph at a specific frame without having to
change the original scene.

Reviewers: sergey, sybren

Differential Revision: https://developer.blender.org/D8616
2020-08-20 16:29:34 +02:00
Sybren A. Stüvel
948e080fc5 Silence -Wmaybe-uninitialized warning on GCC/Linux
Add `-Wno-maybe-uninitialized` option to `CMAKE_CXX_FLAGS_RELEASE` and
`CMAKE_CXX_FLAGS_RELWITHDEBINFO` variables on GCC/Linux.

In Release builds GCC's `-Wmaybe-uninitialized` warning is unreliable,
and thus causes noise that can drown out other warnings. These warnings
are now silenced in release mode builds.a

Debug builds seem fine, so flags for debug builds are not touched by
this commit.

No functional changes.

Reviewed By: Sergey

Differential Revision: https://developer.blender.org/D8615
2020-08-20 16:12:28 +02:00
7fac0f9cd5 Selection: Fix lasso selection invisible 2020-08-20 16:11:14 +02:00
121d3181f9 GPU: Fix some more remaining GL enums scattered outside of GL module
This fixes an assert inside the lasso selection drawing.
2020-08-20 16:11:14 +02:00
19d72175ba GPUShaderInterface: GL backend isolation 2020-08-20 16:11:14 +02:00
14fcd46ca7 GPU: Use GPUShader setters for uniforms removing uses of ShaderInterface 2020-08-20 16:11:14 +02:00
5e65498e3d DRW: Remove some more direct gl state modification. 2020-08-20 16:11:14 +02:00
f364d181e3 UI: Fix collapsed panels not drawing header buttons
Error in rB940b239ad473 left a check for open panels after the
"vertical" check was removed.
2020-08-20 10:04:17 -04:00
f9697543e4 Revert "Cleanup: Use LISTBASE_FOREACH in editors screen directory"
This reverts commit 52f40bcff2.

Apologies for the noise. I caught a problem with this that I hadn't before. I will
commit later after thorough testing.
2020-08-20 09:34:09 -04:00
52f40bcff2 Cleanup: Use LISTBASE_FOREACH in editors screen directory
Differential Revision: https://developer.blender.org/D8653
2020-08-20 09:29:01 -04:00
a12d046910 Merge branch 'blender-v2.90-release' into master 2020-08-20 22:00:51 +10:00
c74b4caa72 Fix incorrect mask use with curves
Ref D8652
2020-08-20 21:51:35 +10:00
5e85c9878b Fix cloth collision clamp having no effect
And rename `cloth_selfcollision_impulse_vert` to `cloth_collision_impulse_vert`
2020-08-20 08:24:32 -03:00
f9b4fb7206 Cleanup: Outliner: LibOverride tools.
Remove useless extra-processing, comments, etc.
2020-08-20 12:41:14 +02:00
4aa04b6490 LibOverride: Add 'delete and use linked data' operation.
This will re-link all usages of a library override data-block
(including all of its override dependencies) to its reference linked
IDs, and delete those liboverrides.

As usual, it is available in the ID sub-menu of the outliner context
right-click menu.

Part of T76555.
2020-08-20 12:35:16 +02:00
59180ff153 Merge branch 'blender-v2.90-release' into master
Conflicts:
	source/blender/makesrna/intern/rna_scene.c
2020-08-20 11:54:46 +02:00
0fae682d61 Fix T79935: Inonsistent simplify behavior when linking collection with objects in sub-collection.
RNA update function would only update objects from 'main' instantiated
collection, not those from sub-collections.

This should be comitted to 2.90 (and backported to 2.83 too).

Maniphest Tasks: T79935

Differential Revision: https://developer.blender.org/D8654
2020-08-20 11:52:12 +02:00
341ff17326 Fix T79935: Inonsistent simplify behavior when linking collection with objects in sub-collection.
RNA update function would only update objects from 'main' instantiated
collection, not those from sub-collections.

This should be comitted to 2.90 (and backported to 2.83 too).

Maniphest Tasks: T79935

Differential Revision: https://developer.blender.org/D8654
2020-08-20 10:39:28 +02:00
efa7aaa97f Cleanup: use const variables where possible in the Python API 2020-08-20 16:10:13 +10:00
8877e3aa62 Cleanup: clang-format 2020-08-20 16:09:48 +10:00
07753fa825 Docs: Update BPY to manual mappings 2020-08-19 21:47:36 -04:00
48325306d9 Cleanup: Outliner active indicator repeated code
Refactor the code to draw the roundrect behind outliner icons for active
elements into a single function.

No functional changes.
2020-08-19 19:35:47 -06:00
940b239ad4 Cleanup: Remove unused variables for horizontal panels
Continuing the work of eb9055a572, remove remaining unecessary
variables and arguments that were related tabbing and horizontal
alignment of panels. For example, "vertical" was always true, and
removing that exposed other unused variables.
2020-08-19 18:55:04 -04:00
50b435cbaa Cleanup: Remove unused variable 2020-08-19 18:05:03 -04:00
4f6051e8c4 BLI: fix memory leak in delaunay 2d
Differential Revision: https://developer.blender.org/D8633
2020-08-19 18:45:48 +02:00
48bd6e7102 Tests: use guarded allocator in tests
This helps finding memory leaks in tests.

Reviewers: brecht

Differential Revision: https://developer.blender.org/D8631
2020-08-19 18:18:20 +02:00
eb9055a572 UI: Remove panel X axis closing code
Horizontal panel alignment hasn't been used for years, and we have no
plans to use it in the future. It adds a fair amount of complexity to
the panel code which makes adding features take longer.

This code removes the X closing flag, and all of the logic / variables
unused without it.

This commit includes a file subversion bump.

Differential Revision: https://developer.blender.org/D8601
2020-08-19 11:37:21 -04:00
f61927d946 BLI: improve leak detection in tests
This actually found a bug in my previous commit.
2020-08-19 17:27:58 +02:00
1dafa87eb5 GPUState: Fix signed / bitfield conversion leading to wrong enum value
This was creating drawing issues on windows builds.
2020-08-19 17:13:53 +02:00
fccb38cf19 Fix warning from narrowing conversion 2020-08-19 16:56:36 +02:00
2aff45146f BLI: improve exception safety of Vector, Array and Stack
Using C++ exceptions in Blender is difficult, due to the large
number of C functions in the call stack. However, C++ data
structures in blenlib should at least try to be exception safe,
so that they can be used if someone wants to use exceptions
in some isolated area.

This patch improves the exception safety of the Vector, Array
and Stack data structure. This is mainly achieved by reordering
some lines and doing some explicit exception handling.
I don't expect performance of common operations to be affected
by this change.

The three containers are supposed to provide at least the
basic exception guarantee for most methods (except for e.g.
`*_unchecked` methods). So, resources should not leak when
the contained type throws an exception.

I also added new unit tests that test the exception handling
in various cases.
2020-08-19 16:44:59 +02:00
aeaf2b0dd4 LibOverride: Add initial version of 'resync' operation.
Available from the usual ID submenu in the Outliner context menu.

The goal of this operator is to re-create the override from the linked
data, while preserving existing defined overrides.

This allows to update local opverrides when relations between datablocks
are changed in source library linked data.

Part of T76555.
2020-08-19 16:27:49 +02:00
aa1e4baa22 Cycles : add a Volume Geometry Node
This splits the volume related data (properties for rendering and attributes) of the Mesh node
into a new `Volume` node type.

This `Volume` node derives from the `Mesh` class since we generate a mesh for the bounds of the
volume, as such we can safely work on `Volumes` as if they were `Meshes`, e.g. for BVH creation.
However such code should still check for the geometry type of the object to be `MESH` or `VOLUME`
which may be bug prone if this is forgotten.

This is part of T79131.

Reviewed By: brecht

Maniphest Tasks: T79131

Differential Revision: https://developer.blender.org/D8538
2020-08-19 15:47:09 +02:00
3e56dd8fd9 GPencil: Change default Onion Keyframe mode to ALL
Now by default the selection mode is All keyframes types.

Also removed the icon for All option and renamed from `All Types`to `All`.

UI review by @pablovazquez
2020-08-19 15:30:38 +02:00
5cc08510e0 RNA: Validate scene/view-layer combination for statistics query
Users may input an invalid scene/view-layer combination via Python. We
can easily detect that and fail gracefully.

Besides checking input parameters in RNA, also assert the
scene/view-layer combination is valid in lower level Depsgraph lookup
function (called by statistics query).
2020-08-19 12:37:59 +02:00
8cbfc4c76e Fix T79816: Restore scene.statistics() BPY function
This RNA/BPY function was removed in c08d847488. For understandable
reasons really-- getting scene statistics from a string displayed in the
status bar is not exactly the best design. But we have committed to not
changing the RNA API too much for the 2.90 release, so we would like to
keep this functionality.

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

Reviewd by: Julian Eisel
2020-08-19 12:37:59 +02:00
5549ee2e08 Fix incorrect number of recent items displayed in splash
After recent code cleanup in rB349eebd7.
2020-08-19 12:26:49 +02:00
83c78529b9 Fix T79816: Restore scene.statistics() BPY function
This RNA/BPY function was removed in c08d847488. For understandable
reasons really-- getting scene statistics from a string displayed in the
status bar is not exactly the best design. But we have committed to not
changing the RNA API too much for the 2.90 release, so we would like to
keep this functionality.

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

Reviewd by: Julian Eisel
2020-08-19 12:14:03 +02:00
c5d33070fd Cleanup: compiler warnings 2020-08-19 12:11:48 +02:00
e9e493977c GPUShader: Fix apple clang warnings 2020-08-19 11:57:28 +02:00
d412a5e6fa DRW: Fix crash drawing gpencil 2020-08-19 11:54:05 +02:00
90ee622830 Turn experimental features ON for master
During alpha the user preferences > experimental featuers are available
to prevent merge issues and allow developers to seek feedback.

This needs to be manually turned off when we branch for beta, otherwise
the RNA of the incomplete features will be exposed.
2020-08-19 10:23:21 +02:00
ffb8fca751 Revert "Turn experimental features on for master (alpha)"
I turned on the wrong feature in cmake.
This reverts commit bdf43213b2.
2020-08-19 10:22:00 +02:00
97dc370c50 Fix compiler error in MSVSC
Introduced in: rB20a8edaa725ddbae16179d2f7cea88c097c61615

It broke building on windows, initializing a static may not be done with a function in C.
2020-08-19 08:58:29 +02:00
638fa188b7 Merge branch 'blender-v2.90-release' into master 2020-08-19 14:45:21 +10:00
Hans Goudey
04ca28a6e0 Fix T77300: Some scientific notation evaluation has incorrect results
Ref D7922
2020-08-19 14:44:42 +10:00
d3bf4929de Cleanup: update mball.c comments
Some errors in comments, references to old function names.
2020-08-19 14:16:25 +10:00
7a602fb525 Cleanup: spelling 2020-08-19 14:04:36 +10:00
3f43f57731 Cleanup: warnings 2020-08-19 13:52:48 +10:00
33a4a6dd66 Merge branch 'blender-v2.90-release' into master 2020-08-19 13:51:14 +10:00
762e4cf221 BLI_listbase: add utility macro for looping over lists with an index
Add to the 2.90 branch to avoid problems if fixes from master use it.
2020-08-19 13:43:51 +10:00
349eebd7d1 UI Code Quality: Use LISTBASE_FOREACH in interface directory
I only skipped a few loops in the monstrous ui_handle_menu_event
function. Also, I only changed variable names where necessary to
prevent redeclarations.

Differential Revision: https://developer.blender.org/D8586
2020-08-18 21:47:00 -04:00
ffa8e75799 BLI Listbase: Add iterator macro that increments an index 2020-08-18 21:38:18 -04:00
78d6c273b7 Merge branch 'blender-v2.90-release'
# Conflicts:
#	source/blender/editors/space_sequencer/sequencer_draw.c
2020-08-18 21:30:52 +02:00
33fde699e2 Cleanup: GPUState: Remove GPU_state_init() 2020-08-18 21:30:11 +02:00
e5796233c7 GPUState: Use GPU_viewport to set viewport state in GPU_framebuffer
also fix a small issue in GPU_texture_clear.
2020-08-18 21:30:11 +02:00
adca09b643 GPUState: Port default state to StateManager constructor 2020-08-18 21:30:11 +02:00
a9f2ebb215 Cleanup: DRW: Use GPUState instead of raw opengl calls
Should not break anything! Huh!
2020-08-18 21:30:10 +02:00
536c2e0ec9 GPUState: Only apply state before drawing 2020-08-18 21:30:10 +02:00
482a51aabf Cleanup: GPUState: Remove stack from the state manager and rename it 2020-08-18 21:30:10 +02:00
d10f000322 GPUState: Remove gpuPushAttr/gpuPopAttr
And use manual save/restore mechanism.

The stack method is not used so much to be considered useful.
2020-08-18 21:30:10 +02:00
f30df15edc GPUState: Make use of GPUStateStack class
This isolate most GL calls to the GL backend. Still a few remains.
2020-08-18 21:30:10 +02:00
298329554a Cleanup: GPUState: remove double GPU_blend calls 2020-08-18 21:30:10 +02:00
bf1b622dd9 GPUState: GPU_blend final API renaming
We now use GPU_blend for enabling / disabling blending and explicitly
set the blend equation.
2020-08-18 21:30:10 +02:00
10558d6973 Cleanup: GPUState: remove use of GPU_blend_set_func 2020-08-18 21:30:10 +02:00
969bcf0793 Cleanup: GPUState: Replace blend func separate by enum 2020-08-18 21:30:10 +02:00
a1459b2f7a Cleanup: GPU: Move towards an explicit Blend state
This make use of the GLStateStack functions for:
- `GPU_blend()`
- `GPU_blend_set_func()`
- `GPU_blend_set_func_separate()`

The goal is to unify them using an explicit state setting.
This will remove the need to use obscure blend functions
2020-08-18 21:30:10 +02:00
2ae1c895a2 GPUState: Add GL backend and state tracking but do not use it
This is just the backend work. It is not plugged in yet because it
needs more external cleanup/refactor.
2020-08-18 21:30:10 +02:00
2eddfa85e0 Cleanup: GPU: Remove uneeded depth precision getter.
We always use 24bit framebuffers nowadays.
2020-08-18 21:30:10 +02:00
0f292dc072 Cleanup: GPUState: remove float variant of GPU_scissor_get 2020-08-18 21:30:10 +02:00
c78ea96528 GPUShader: Add debug labels
This allow better debugging inside renderdoc.
2020-08-18 21:30:10 +02:00
ba3c18f4b2 GPUShader: Add back vertformat_from_shader() 2020-08-18 21:30:10 +02:00
e8c48ce075 GPUShader: Improve auto name
Use macro to get calling function name. Helps debugging shaders.
2020-08-18 21:30:10 +02:00
e43e9caf1b GPUShader: Rewrite error printing
Now error printing only display the line related to the error.
We also put char marker if present.

Example:
```
-- Shader Compilation Errors : MAMaterial --

10414 |  node_fresnel(, facingnormal, viewposition, tmp34);
      |               ^
      | error: syntax error, unexpected ',', expecting ')'

----------------------------------
```
2020-08-18 21:30:10 +02:00
216d78687d GPUShader: GL backend isolation 2020-08-18 21:30:09 +02:00
df28d2c27e Cleanup: GPU: Replace Batch uniform by shader uniform using macro
This is a first step into removing uniforms from GPU_batch and Imm.
2020-08-18 21:30:09 +02:00
d5b5b228e4 UI: Fix protential stray GPU state preventing correct drawing
Fix potential issue with nodetree introduced in rB47c6f41b8926.
2020-08-18 21:29:47 +02:00
b8b56ee172 BLI_kdopbvh: Adjust epsilon according to the axis
This corrects the overlap detection for cloths since in this case kdop26
is used and epsilon represents the distance.
2020-08-18 14:08:58 -03:00
80face1be5 Depsgraph: simplify DEG_evaluate_* API
This mainly removes the bmain argument, which can be
retrieved from the graph itself.

Also, I removed some outdated/unnecessary comments.

Reviewers: sergey, sybren

Differential Revision: https://developer.blender.org/D8614
2020-08-18 17:40:56 +02:00
c2f0522760 Sculpt: Enable Cloth Simulation Target for Pose and Boundary
This adds a new brush property called "Deformation Target" which
controls how the brush deformations is going to affect the mesh data. By
default is set to Geometry, which makes the brushes displace the
vertices. When set to Cloth Simulation, the deformation of the brush is
applied to the cloth solver constraints, so the simulation is
responsible to apply the final deformation. This allows to add cloth
simulation effects to other sculpt tools with minor modifications to their
code.

This patch enables Cloth Simulation deformation target for Pose and
Boundary brushes, which are tools that are already designed to work in
low poly counts and produce large deformations. This allows creating the
most common cloth effects, like bending and compressing folds, without
relying on collisions.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D8578
2020-08-18 17:16:35 +02:00
bedd6f90ca Sculpt: Erase Displacement Mesh Filter
Same concept as the Multires Displacement Eraser Brush but implemented
as a mesh Filter. This allows to delete the displacement of an entire
area uniformly.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D8608
2020-08-18 17:04:24 +02:00
0957189d4a Sculpt: Enhance Details Mesh Filter
Exact same operation as D8509, implemented as a Mesh Filter.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D8510
2020-08-18 16:56:44 +02:00
55087b84b8 Cleanup: Node: Use checker shader for preview background
Removes many drawcalls which might have slowdown the UI.
2020-08-18 16:15:34 +02:00
3e5431fdf4 Sculpt: Invert Smooth to Enhance Details
This enables the invert mode in the smooth brush as Enhance Details.
The operation is similar to the Sharpen Filter intensify details parameter,
which consist in applying the laplacian smooth displacement in the opposite
direction calculated using the original coordinates.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D8509
2020-08-18 16:14:10 +02:00
872efd8d73 Merge branch 'blender-v2.90-release'
# Conflicts:
#	source/blender/editors/space_node/node_draw.c
#	source/blender/editors/space_sequencer/sequencer_draw.c
2020-08-18 16:04:41 +02:00
b3b67a61b7 Fix compiler error in MSVSC
Introduced in: rB20a8edaa725ddbae16179d2f7cea88c097c61615

It broke building on windows, initializing a static may not be done with a function in C.
2020-08-18 15:59:03 +02:00
5195d346f4 Fix T79714: Projecting texture from camera fails
The evaluated mesh is now only recomputed when the required data layers
are missing. Previously the evaluated mesh was re-evaluated incorrectly,
which caused the stippled result and the failing assert.

Since now only the evaluated mesh is used, and never a temporary mesh,
there is also no more need to keep track of whether the mesh needs
freeing or not.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D8574
2020-08-18 15:53:28 +02:00
6a4f5e6a8c Depsgraph: simplify build API
Reviewers: sergey, sybren

Differential Revision: https://developer.blender.org/D8611
2020-08-18 15:51:32 +02:00
47c6f41b89 Fix T77564: VSE (and compositor background) lost stereoscopy preview
Issue introduced on fe045b2b77.

Since the stereoscopy compositing (anaglyph, ...) is only done for
viewports the VSE preview and compositor need to use viewports.

Reviewed by: dfelinto

Differential Revision: https://developer.blender.org/D8472
2020-08-18 15:50:49 +02:00
d9f7cbb8af Cleanup: remove bmain argument from BKE_scene_graph_update_for_newframe
Reviewers: sergey

Differential Revision: https://developer.blender.org/D8613
2020-08-18 15:45:58 +02:00
f653a4f349 Cleanup: remove outdated comments 2020-08-18 15:41:26 +02:00
2922f9b83d Cleanup: remove TimeSourceNode->cfra which is never read 2020-08-18 15:40:29 +02:00
2e908156d0 Fix T77564: VSE (and compositor background) lost stereoscopy preview
Issue introduced on fe045b2b77.

Since the stereoscopy compositing (anaglyph, ...) is only done for
viewports the VSE preview and compositor need to use viewports.

Reviewed by: dfelinto

Differential Revision: https://developer.blender.org/D8472
2020-08-18 15:39:27 +02:00
63998d3522 Cleanup: remove unused TimeSourceNode->offset 2020-08-18 15:32:43 +02:00
89a374cd96 Sculpt: Sculpt Filter Orientation Options
Previously, the XYZ deform axis of the Mesh Filter were limited to
object space (which is the default for sculpt mode). Now it is possible
to limit the XYZ displacement in Local, Global or View space.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D8582
2020-08-18 15:19:54 +02:00
017941057f Fix T79800: Split vertex size for grease pencil
Differential Revision: https://developer.blender.org/D8607
2020-08-18 15:13:53 +02:00
bdf43213b2 Turn experimental features on for master (alpha)
Remember to turn this off again when we branch out for the next beta (2.91)
2020-08-18 14:56:22 +02:00
8ab0d0e399 Merge remote-tracking branch 'origin/blender-v2.90-release' 2020-08-18 14:55:44 +02:00
83e3d25bca Remove (ifdef) RNA for simulation, point cloud and particles
For 2.90 release this should not be exposed in the RNA API.

In master this needs to be ON by default, that's all.

Differential Revision: https://developer.blender.org/D8589
2020-08-18 14:41:16 +02:00
c526a34fc2 Cleanup: Fix strict compiler warning 2020-08-18 14:38:07 +02:00
1da0685076 Cycles: add a Pass Node
The Pass struct is now a Node and the passes are moved from the Film
class to the Scene class.

The Pass Node only has `type` and `name` as sockets as those seem to be
the only properties settable by exporters (other properties are implicit
and depend on the pass type).

This is part of T79131.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D8591
2020-08-18 14:28:59 +02:00
673b1930d8 Merge branch 'blender-v2.90-release' 2020-08-18 14:05:26 +02:00
20a8edaa72 No experimental feature (but debug ones) to work for blender beta/release
Final releases (including beta) should strictly show features that are
finalized to prevent loss of data, old API clanging around, and the
overall quality of the product (Blender) presented.

Note that rendering should never be affected by user preferences, so
this is only changing things in the UI level.

Development note: This is reset experimental UI on file load.
Also note: to hide RNA (needed for hair and particles) will be done as a
separate patch.

Differential Revision: https://developer.blender.org/D8606
2020-08-18 14:02:47 +02:00
aba46371a1 GPUTexture: Extend CUBE_MAP_ARRAY_ARB proxy workaround to all Apple gpus
Related to T79716
2020-08-18 14:01:14 +02:00
41235eed1d GPU: Avoid invalid GL API usage
Drawing with 0 sized buffer is prohibited.
2020-08-18 13:53:07 +02:00
fe1827df82 Fix T79782 GPU: Crash cause by shadow batch reference
After drawing, the batch could be reset and draw again using other
parameters.

Avoid having to track references by setting the batch pointer to NULL after
drawing.
2020-08-18 13:53:07 +02:00
4814836120 Sculpt: Option to limit the forces axis in the Cloth Filter
This uses the same concept of the Mesh Filter but for applying the cloth
filter forces, so now it can be limited to a specific axis.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D8567
2020-08-18 13:28:37 +02:00
976f0113e0 Multires: Base Mesh Sculpting
This adds an option to the Multires modifier to sculpt directly on the
base mesh while previewing the displacement of a higher subdivisions
level. What this does it considering Multires as a regular modifier
without exposing the grid displacement to sculpt mode.

This allows to see the propagation happening in real time, which enables
to use complex tools like Cloth or Pose in much higher resolutions and
without surface noise and artifacts.

Reviewed By: sergey, Severin

Differential Revision: https://developer.blender.org/D8555
2020-08-18 13:11:23 +02:00
df495e758d Cleanup: use Span instead of separate pointer and length
Reviewers: sergey

Differential Revision: https://developer.blender.org/D8605
2020-08-18 13:06:31 +02:00
fc5eab3570 Mesh: merge mesh_create_eval_final_{view,render} functions
Functions `mesh_create_eval_final_view()` and
`mesh_create_eval_final_render()` were doing the exact same thing,
except for a hack introduced in d3eb9dddd6 (2012-10-08, Better fix for
T32846: dupligroup messes up particle instancing on rendering) that
appears to be no longer necessary. Besides that, these functions had
confusing names. Their functionality changed over time, and whether to
do for-render or for-viewport evaluation is now actually determined by
the depsgraph evaluation mode. This means that the `..._render` function
could evaluate a mesh with viewport settings, and vice versa.

The functions are now merged into `mesh_create_eval_final()`, and the
hack has been removed. The `OB_NO_PSYS_UPDATE` flag has been removed
entirely (instead of keeping it around as deprecated flag), because it
was always only temporarily set on objects during mesh evaluation and
thus not saved to the blend file.

No expected functional changes as far as users are concerned.
2020-08-18 12:58:48 +02:00
e371378c8b Cleanup: rename bdata to boundary
Reviewed By: sergey

Differential Revision: https://developer.blender.org/D8556
2020-08-18 12:48:56 +02:00
701a026d95 Merge branch 'blender-v2.90-release' into master 2020-08-18 12:46:17 +02:00
6df4b00f5f Fix IDProps definition still being editable in liboverrides.
One should be able to edit overridable IDProps values, but never their
settings/definitions.

Note that being able to add new IDProps to overrides is still a TODO.

Reported by Josephbburg (@Josephbburg) over blenderchat, thanks.
2020-08-18 12:43:42 +02:00
5aecc4b57b Fix Cloth Brush Grab deform types not working with spacing
Even the Cloth Brush grab works like a regular grab brush, it makes
sense to support spacing just in this brush in order to prevent creating
more brush steps that update the simulation. This way, it is possible to
create grab brushes that update the simulation constantly while grabbing
(using the dots stroke mode) or brushes that only update the simulation
when the cursor moves (using spacing).

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D8568
2020-08-18 12:36:48 +02:00
Pablo Dobarro
e3eb53a5b3 Cleanup: Remove unused code in the Paint Cursor
This code was left here after the refactor, it was doing nothing and it
was causing an assert.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D8579
2020-08-18 12:35:37 +02:00
762daacbc7 Fix Face Set Visibility operator using wrong active Face Set
The Face Set visibility operator was using the last active Face Set
updated by the paint cursor, so when the paint cursor is not used (when
using a filter or a transform tool), the active Face Set was not updating
and it was hidding the wrong Face Set based on the last cursor position
with a brush tool active. Now the Face Set Visitility operator has an
invoke callback wich forces a active vertex and face set update
regardless of the active tool, so it should always work correctly.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D8580
2020-08-18 12:33:54 +02:00
cfeadaa295 Fix Mesh Filter deformation axis UI layout
This uses a single row for the three axis instead of a row per axis.

Reviewed By: sergey, Severin

Differential Revision: https://developer.blender.org/D8581
2020-08-18 12:32:58 +02:00
6a6cb83eb3 Fix T79568 EEVEE: Film transparent not working
Since world shader use the same standard output and are considered opaque,
we need to set alpha as holdout.
2020-08-18 12:26:22 +02:00
ca7414c4cb Fix Mask Slice deleting the Face Sets
This was a TODO in the code. Previously the Face Set datalayer was
deleted and recreated with a constant ID of 0. Now the datalayer is
preserved and set to the SculptSession after slicing the mask and a new
ID is calculated for the new faces that the slicing operation produced,
so they can be easily isolated for further tweaking.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D8583
2020-08-18 12:20:05 +02:00
db4e08dfdc Sculpt: Expose the functions to create and init a SculptClothSimulation
This will be used for new features like supporting cloth deformation in
other brushes and tools outside of the cloth brush code.
No functional changes.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D8602
2020-08-18 12:17:14 +02:00
c82166ffcd Cycles: move some Scene related methods out of Session
This moves `Session::get_requested_device_features`,
`Session::load_kernels`, and `Session::update_scene` out of `Session`
and into `Scene`, as mentioned in D8544.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D8590
2020-08-18 11:50:37 +02:00
286fc2233d Merge branch 'blender-v2.90-release' into master 2020-08-18 11:39:36 +02:00
0b49fdd0ee Fix/cleanup Constraint poll function in liboverride cases.
Some constraint-specific operators, like set/clear inverse matrix of
childof constraint, are also valid on original, linked/overridden
constraints.

Similar change to what was done to modifiers poll function a few days
ago.

Reported by Josephbburg (@Josephbburg) over IRC, thanks.
2020-08-18 11:36:34 +02:00
400ab19702 Build deps: Enable SSE optimization for FFmpeg
The description is self-explanatory: enable SSE optimizations in the
FFmpeg library. They were disabled from the very beginning of the
dependency builder, possibly due to portability concerns.

FFmpeg does perform runtime check for available CPU microarchitectures,
so the codecs will still run on older hardware, but they will run way
faster on newer hardware.

For example, re-encoding 3405 2560x1376 frames on Xeon E5-2699 V4 CPU
went down from 313sec to 210.

Differential Revision: https://developer.blender.org/D8594
2020-08-18 11:17:26 +02:00
be30023c68 Merge branch 'blender-v2.90-release' 2020-08-18 09:52:20 +02:00
567e333ea4 Fix T79580: Control Mesh Only Partially Drawn After Filling a Surface From a Cage of Surface Curves
Differential Revision: https://developer.blender.org/D8600
2020-08-18 09:51:36 +02:00
ff3ecf4aa9 Merge branch 'blender-v2.90-release' 2020-08-18 08:39:13 +02:00
f94e322ab7 Fix T79770: Crash opening 2.83 .blend with linked collection containing greasepencil object in 2.91
The scene was null and could not be patched.
2020-08-18 08:36:26 +02:00
a8a048915e Cleanup: use view-zoom enum type 2020-08-18 12:30:10 +10:00
3c690aa4bc Merge branch 'blender-v2.90-release' into master 2020-08-18 12:29:15 +10:00
d1057890c4 Fix incorrect pixelsize use where DPI scale was intended
Changing line-width shouldn't scale cursor motion. Related to T79787.

Use dpi_fac for scaling curve error threshold & number button drag
threshold calculation.
2020-08-18 12:09:30 +10:00
6978635622 Fix T79787: orbit/zoom sensitivity depends on line-width
Use 'dpi_fac' instead of 'pixelsize' to scale input sensitivity
based on the interface scale.
Also use dpi_fac for view zoom operator.

Thanks to @ISS for investigating.
2020-08-18 11:44:16 +10:00
9085fb8073 Cleanup: expand UserDef pixel-size & DPI documentation
Avoid misunderstandings with UI scaling.
2020-08-18 11:17:15 +10:00
c65c66320f Merge branch 'blender-v2.90-release' 2020-08-17 21:11:29 +02:00
e157573fab Fix T77683: Cycles baking crash with motion blur enabled and no camera
specified

Maniphest Tasks: T77683

Differential Revision: https://developer.blender.org/D8593
2020-08-17 21:04:55 +02:00
45da0d20e6 VSE: make transform effect multithreaded
Multithreaded implementation can provide significant performance gain
on CPU's that can handle more parallel tasks.

On my 8 core system I got about 3.5x faster processing speed.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D8585
2020-08-17 20:52:59 +02:00
8556e801a7 Fix T79594: Define rounding for armature edit props
Define `RNA_def_property_ui_range` for head and tail transform properties.
Step of 10 should match original behavior when tweaking value.

Reviewed By: Severin

Differential Revision: https://developer.blender.org/D8513
2020-08-17 20:49:38 +02:00
Stefan Werner
1c892e6814 Cycles: Fix local intersections in Embree for non-instancd geometry.
Embree's occlusion filter was checking against the wrong object ID
and not exiting correctly in case of a mismatch.

Fixes T79723
2020-08-17 20:41:34 +02:00
118e78a844 Merge branch 'blender-v2.90-release' 2020-08-17 20:39:07 +02:00
4b69e55da3 Fix T79757: Crash on prefetch when renaming strips
Original sequence lookup failed, becase name changed in another thread.
Fix is same as 0471349c90 - stop prefetching before changing content
of seqbase.

I have covered more cases, and added assert so it is more obvious that
issue is in lookup, and it shouldn't fail.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D8592
2020-08-17 20:19:11 +02:00
ac41215f07 Tests: fix Alembic export test on Windows
Convert all `subprocess.run()` arguments to string, to prevent breaking
"does this argument need quoting" checks on Windows.
2020-08-17 20:08:01 +02:00
c6a99e021a Clang tidy: Fix else after return 2020-08-17 14:00:42 -04:00
2b896fc481 Fix T79052: Cycles new sky texture fails with sun size zero
Clamp to a minimum angle to avoid precision issues.
2020-08-17 17:57:29 +02:00
108f3284a7 USD: Allow exporting of invisible objects
The fix for T75936 made it possible to export invisible objects to
Alembic. This commit applies the same approach to the USD exporter.

The USD and Alembic code is slightly different in terms of where in the
exported file the visibility attribute is stored. In USD the visibility
is used to prune the scene graph, and thus there are only two options:
"hidden" and "inherited". Setting the visiblity of a node in the scene
graph to "hidden" immediately hides all its children. To allow hidden
parents with visible children, the visibility is stored on the object
data (so the geometry/camera/lamp/etc) instead.
2020-08-17 17:56:05 +02:00
271361e31f IO: Add test for iterating over invisible objects
Add a test that checks invisible objects are iterated over by the
`IO::AbstractHierarchyIterator` class, when a suitable depsgraph is given.

No functional changes.
2020-08-17 17:56:05 +02:00
a95f863596 Fix T75936: Alembic, allow exporting of invisible objects
Add a new depsgraph builder class that includes invisible objects and
use that in the Alembic exporter.

Alembic supports three options for visibility, "visible", "inherited",
and "hidden". This means that parents can be hidden and still have
visible children (contrary to USD, where invisibility is used to prune
an entire scene graph subtree). Because of this, the visibility is
stored on the transform node, as that represents the Object in Blender
and thus keeps the Alembic file as close to Blender's own structure as
possible.

Reviewed By: Sergey

Differential Revision: https://developer.blender.org/D8595
2020-08-17 17:56:05 +02:00
fd3086833a Cleanup: IO, reduce code duplication in USD and Alembic exporters
Move the object visibility check from Alembic/USD-specific code into the
`io/common` module.

No functional changes.
2020-08-17 17:56:05 +02:00
04ae290024 Cleanup: Alembic, rename test in CMake for consistency
Rename test `alembic_tests` to `alembic_export_tests`, so that its name
is consistent with the Python file containing the tests,
`alembic_export_tests.py`.

No functional changes.
2020-08-17 17:56:05 +02:00
9c241eae48 Fix T79597: Crash with dyntopo after paint cursor refactor
The paint cursor now uses a single call to
SCULPT_cursor_geometry_info_update and the Sculpt API to update both the
radius and the SculptSession data, so random access needs to be
initialized for dyntopo before using API functions.

Reviewed By: sergey

Maniphest Tasks: T79597

Differential Revision: https://developer.blender.org/D8489
2020-08-17 17:34:08 +02:00
fd6725cbfb Merge branch 'blender-v2.90-release' into master 2020-08-17 16:45:30 +02:00
c7a7a38b65 Fix T79633: ovrride apply code broken with RNA-defined runtime IDProps in some cases.
When copying between a set RNA runtime property and an unset one, code
would not behave properly.

We have to also consider NULL 'override apply' callback pointer as a
valid 'use default override apply function' case.
2020-08-17 16:44:36 +02:00
Stefan Werner
d88721879b Cycles: Fix local intersections in Embree for non-instancd geometry.
Embree's occlusion filter was checking against the wrong object ID
and not exiting correctly in case of a mismatch.

Fixes T79723
2020-08-17 16:04:01 +02:00
449ccb7b30 Fix typo: missing f string prefix in Alembic export test 2020-08-17 15:16:20 +02:00
6b6de5beba Cleanup: Alembic tests, add note explaining how the export tests work
No functional changes.
2020-08-17 14:07:45 +02:00
ad459302ce Cleanup: rename alembic_tests.py to alembic_tests_export.py
Rename `alembic_tests.py` to `alembic_tests_export.py`, as this makes it
clearer what is being tested.

No functional changes.
2020-08-17 14:07:45 +02:00
4a2ff0fef8 Tests: Better error reporting in AbstractAlembicTest
Instead of checking for the length of a list, just handle the error that
occurs when the length is incorrect.

No functional changes to any actual test.
2020-08-17 14:07:45 +02:00
38752944f8 Fix formatting bug in AbstractAlembicTest class
Replace `formatstring, value` with the correct `formatstring % value`.

No functional changes to any actual tests.
2020-08-17 14:07:45 +02:00
e14de692fc UI: Only draw node menu search if categories exist
Currently, the search operator in the node add menu NODE_MT_add is drawn
even if no node categories exists. This patch only draws the operator if
at least one node category passes the poll.

This patch is needed because some add-ons use custom search operator and
do not register node categories. In this case, it is undesirable to have
a search operator drawn that do nothing and is not used. One such add-on
is Animation Nodes.

Reviewed By: Jacques Lucke

Differential Revision: https://developer.blender.org/D8576
2020-08-17 13:43:19 +02:00
8fda93a405 Cleanup: Change BLI_bitmap for BLI_edgeset for internal springs
The BLI_bitmap had the potential to eat a lot of memory as it was a
dense map between all the vertices in the mesh.

Now we instead use BLI_edgeset so that we only store data when needed
(creating a spare map instead of a dense).
2020-08-17 12:39:40 +02:00
b2d9020aa5 Fix T77340: nested nodes alpha issues
Reviewers: Severin

Differential Revision: https://developer.blender.org/D8573
2020-08-17 12:34:49 +02:00
68651534c2 Fix T77267: Render EEVEE AO pass when AO disabled.
In EEVEE the AO renderpass influenced other render passes. Until now the
pass wasn't selectable when AO was disabled in the scene to remove these
render artifacts.

This patch allows rendering EEVEE AO pass without enabling it in the
scene. It does this by binding a fallback texture that is used by the
surface shaders.

Reviewed By: Clément Foucault

Differential Revision: https://developer.blender.org/D7956
2020-08-17 11:10:32 +02:00
3d47da9e4c Fix error in recent bpy_interface.c split (missed moving define)
Error in 7341ceb674, this missed moving a local-define when splitting.
2020-08-17 18:53:21 +10:00
6b5582c7f7 Fix: Workbench Depth Of Field Crash
Depth of field compilation failed due to recent refactoring. This only
happened in blender 2.91. This change uses the shader lib to find
dependencies.
2020-08-17 10:50:22 +02:00
0967935b42 Cleanup: split BPY_run_string_ex into two functions
Using a boolean to select between eval/exec behavior wasn't very
readable.
2020-08-17 18:32:20 +10:00
7341ceb674 Cleanup: move Python script execution into BPY_extern_run.h
This commit renames 'execute' to 'run' because:

- This follows Python's "PyRun" which these functions wrap.
- Execution functions can use either exec/eval modes,
  making naming awkward (for future API refactoring).
2020-08-17 18:32:20 +10:00
397cec6a4d Cleanup: Pass 'FILE *' instead of 'void *' for BPY_python_backtrace
This was committed as a temporary workaround in 82150f5641
as release builds were failing (only debug builds worked).

This adds `stdio.h` to the header which is now split into a file that
contains more specialized functionality.

Also move function body inside BPY_python_backtrace,
removing PyC_StackPrint as we have PyC_StackSpit() for
similar functionality that can be called from a debugger.
2020-08-17 18:31:04 +10:00
f8c0d63cdb Cleanup: split BPY_extern_python into it's own header
Currently BPY_extern.h includes too much mixed functionality.
2020-08-17 17:20:12 +10:00
0b4a365183 Cleanup: sort CMake path lists 2020-08-17 12:40:03 +10:00
9a4c019255 Cleanup: header order, trailing space 2020-08-17 12:39:08 +10:00
bee4a2f97c Cleanup: use 'use_' prefix for RNA booleans 2020-08-17 12:35:26 +10:00
9762c3892e Cleanup: spelling 2020-08-17 12:34:05 +10:00
cafe5cd9b0 Cleanup: explain why checking the enabled state twice is needed
Address concern raised with the commit that added this extra check.
2020-08-17 12:33:07 +10:00
5c78c16b14 UI: Simplify cloth filter type description
Remove extra words in the message and avoid repeating
the name in the description.
2020-08-16 08:57:46 -04:00
4f57e1aaea Merge branch 'blender-v2.90-release' 2020-08-16 08:54:27 -04:00
8010cbe620 Fix T79823: Typo in cloth filter type description 2020-08-16 08:54:07 -04:00
b0b0d9f2cf Merge branch 'blender-v2.90-release' into master 2020-08-16 21:21:20 +10:00
59bc71d69b Fix popups opening in the wrong direction over headers
Checks for header alignment didn't account for tool-header & header
having different alignment.

There is no reason to use a lookup function on the area
(ED_area_header_alignment) as we already have region.

Check the regions alignment directly, remove access functions.
2020-08-16 21:14:26 +10:00
d5d83b71f7 Merge branch 'blender-v2.90-release' into master 2020-08-16 14:21:04 +10:00
73fb445b8d Fix T78426: Header flips when changing editors
The existing header flip detection didn't account for mixed
tool-header and header flipping & visibility between space-types.

Now alignment syncing handles any combination of header,
tool-header & footer flipped state, in a way that can be extended
to other region types in the future.
2020-08-16 14:18:40 +10:00
93304b483a Cleanup: Quiet GCC maybe uninitialized warning
There was a false positive here. Thankfully, marking the button's type
as constant can quiet the warning.
2020-08-15 22:20:40 -04:00
2c61c3d733 deps_builder: Fix boost::python linking release python library
By default boost::python in debug configuration links the release
python libraries. Which leads to loading issues with the produced
modules in a debug blender (which does use the debug python libs)

Bjam has an option to switch this to the debug libraries but when
you switch that on it changes the library names for *all* boost
libraries, even ones that don't have anything to do with python
and even the release libraries.

therefore an alternative way has been chosen and we're dealing
with this by adding a define rather than asking bjam to do it.
2020-08-15 11:06:16 -06:00
199e308670 Fix T79790: GPencil sculpt strength icon changed in recent cleanup
This commit restores the vertex colors which were lost in the cleanup.
2020-08-14 16:53:14 -04:00
80982941bd Merge branch 'blender-v2.90-release' 2020-08-14 16:39:35 -04:00
c300fc56c3 UI: Fix type in multires modifier subpanel
Thanks to @zanqdo for reporting "Subdivions"

Also remove the empty space I left for the "Delete Lower" operator that
never made it into 2.90.
2020-08-14 16:34:48 -04:00
36e4d4af5b Fix T79772: Gpencil. Additive drawing doesn't work when creating fills
This option was not supported in Fill tool
2020-08-14 19:05:05 +02:00
f491442eb0 Merge branch 'blender-v2.90-release' 2020-08-14 13:01:05 -04:00
9ab3b8f7f4 UI: Remove cutoff text in popovers for 2.90 release
Many of these popovers could use a design pass in 2.91, but for 2.90 we
don't want to change any UI strings at this point, so the best way to
solve the cutoff text is to widen the popovers. Sadly this won't affect
popovers when other languages besides English have longer strings, but
solving that is a much larger task.

Another benefit is that tweaking sculpt / paint brush options feels much
less cramped with slightly wider popovers.

I only know of one string that is still slightly cutoff by default with
this patch, the "Max Element Distance" property of the pose brush in the
sculpt mode brush settings popover. But I didn't think it was worth
widening that popover more to deal with that one case.

Differential Revision: https://developer.blender.org/D8575
2020-08-14 12:58:24 -04:00
e037c7230d Merge branch 'blender-v2.90-release' 2020-08-14 17:58:05 +02:00
04f703fca6 Fix warning when compiling on Linux with WITH_XR_OPENXR enabled 2020-08-14 17:57:24 +02:00
e8dfe91767 Merge branch 'blender-v2.90-release' 2020-08-14 17:18:09 +02:00
b3c08a3a0a Fix constant lighting change in VR view when rotating head
We have to explicitly enable fixed world space lighting. This was in
fact already done, but overridden by the code to sync the 3D View
shading settings to the VR view.
2020-08-14 17:03:10 +02:00
c074943dfd Fix undefined behavior with --debug-xr
Mistake in cb578ca104. Before that, the extension vector was static,
to make sure the extension name strings wouldn't get destructed when
leaving the function. I didn't think that was an issue and couldn't
recreate one, because until the previous commit we wouldn't actually
add any extensions to the vector on Windows (the system I tested
with).

Use C++17's `std::string_view` now, which avoids the string copies
`std::string` creates for itself and thus its destruction when leaving
the local scope.
2020-08-14 17:03:10 +02:00
77e4905b17 Fix --debug-xr not outputting OpenXR debug prints on Windows
The OpenXR debug extension was disabled on Windows as a workaround. This
was an old leftover from when there was only the Windows Mixed Reality
runtime on Windows. The debug extension didn't work for it and we didn't
have a way to disable it just for Windows Mixed Reality.
Now it seems to work though, so we remove the workaround. If specific
runtimes still have trouble with the extension, we can disable it
specifically for these runtimes now.
2020-08-14 17:03:10 +02:00
d958ab62e7 Fix NULL pointer access in render engine reported by address sanitizer
This may not have caused an actual bug.
2020-08-14 16:49:22 +02:00
690d76c624 Fix T79769, T79768: crash tweaking volume settings with Cycles viewport render
Refitting the BVH does not work in this case, it needs to be fully rebuilt.
2020-08-14 16:49:08 +02:00
d117520aa2 Merge branch 'blender-v2.90-release' 2020-08-14 16:00:54 +02:00
cb578ca104 Fix/workaround graphics issues breaking SteamVR use with Blender
Windows only workaround. I'll have to investigate Linux separately.

Steam's OpenGL compatibility is still new and doesn't work for us yet
(neither does it for standard OpenXR examples from what I've heard and
seen myself). We can work around that by falling back to our DirectX
compatibility layer.
Note that this DirectX compatibility still doesn't work for some
systems, see T76082.

Implementation note: Since the graphics binding extensions have to be
enabled before we can find out which runtime is in use (e.g. SteamVR vs.
Oculus, etc), we can now enable multiple graphics binding extensions but
settle for a single one to use later.

Once the SteamVR OpenGL backend works, we can remove this workaround
again.

Fixes T78267.
2020-08-14 16:00:03 +02:00
6a561367d0 Merge branch 'blender-v2.90-release' 2020-08-14 13:29:03 +02:00
ab3a651515 Fix offset applied on top of VR landmark with no positional tracking
On VR session start with positional tracking disabled, the pose would
have an offset applied but it was supposed to start exactly at the
landmark position.

Issue is that we applied the offset to cancel out the position offset
reported by the OpenXR runtime incorrectly. We only want to do that if
positional tracking is enabled, because if not we don't even apply the
runtime's position offset. So we'd cancel something out that wasn't
there.
2020-08-14 13:27:09 +02:00
cc6c52768a BLI: add reverse iterators, iterator constructor and Vector.insert/prepend
The new reverse iterators behave as the reverse iterators for contains from
the standard library. Have a look at the tests to see how to use them.
Using them will hopefully become easier with ranges in C++20.

A Vector can now be constructed from two iterators, which is very common
in the standard library.

New Vector.insert methods allow adding elements in the middle of a vector.
These methods should not be used often in practice, because they has a linear running time.

New Vector.prepend methods allow adding elements to the beginning of a vector.
These methods are O(n) as well.
2020-08-14 13:16:44 +02:00
2d65336408 Cleanup: C++ code style for Ghost-XR
* Avoid deep copy of vectors (technically more than a cleanup).
* Use `std::make_unique` for allocating unique pointers, rather than
  manual `new`.
* Use `std::optional` for optional by-value return values, rather than
  C-style `bool` to indicate success + return-argument.
* Use references rather than pointers for non-optional arguments.
* Avoid manual `new`/`delete`. Use `std::unique_ptr` for local scope
  bound lifetime.
* Use C++ `nullptr` rather than C's `NULL`.
* Remove unnecessary friend declaration.

These changes are generally considered good practise and move us more to
a "modern C++" style. We can still go much further of course.
See https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines.
2020-08-14 12:37:53 +02:00
1ff1b7fcea Merge remote-tracking branch 'origin/blender-v2.90-release' 2020-08-14 11:38:54 +02:00
4c625df759 Fix: Increase Viewport Sculpt Options panel width
The "Delay Viewport Update" label was showing only:
"Delay Viewport U..."
2020-08-14 11:36:40 +02:00
24f7f33c25 Merge branch 'blender-v2.90-release' 2020-08-14 10:40:57 +02:00
a5cf71fa5d Fix (unreported) sculpt vertex color panel visible for all object types
Since DATA_PT_sculpt_vertex_colors has its own poll() we need to call
the poll() of MeshButtonsPanel as well

Differential Revision: https://developer.blender.org/D8563
2020-08-14 10:35:30 +02:00
d0c0a2e392 UI: Correct grammar in property name and description 2020-08-13 22:13:43 -04:00
cd179b5048 UI Code Quality: Use derived struct for color ramp buttons
The same changes as rB570044e9f412 and rB0ab21bf06ae0.
2020-08-13 22:00:50 -04:00
0ab21bf06a UI Code Quality: Use derived struct for curve mapping buttons
The same changes as in rB570044e9f412.
2020-08-13 21:33:47 -04:00
570044e9f4 UI Code Quality: Use derived struct for curve profile buttons
Continuing the work from rB49f088e2d093.

Differential Revision: https://developer.blender.org/D8561
2020-08-13 21:00:54 -04:00
275f1039d2 GPencil: Fix keymap error for Fill Boundary strokes
The key to enable it is `Alt`
2020-08-13 20:18:30 +02:00
ebf5ff8afb GPencil: Display Fill Boundary strokes with stroke color
This feature was removed during the refactor, but it's needed for this type of strokes to display the line using the stroke color without checking if the stroke is enabled or not in the material.

This color is used only for these special strokes.
2020-08-13 20:18:29 +02:00
e691a3a9b7 Deps_builder: Update openvdb to a dynamic library
This patch changes openvdb from a static to a dynamic library.
this is in preparation for enabling pyopenvdb at some point
in the future.

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

Reviewed by: brecht
2020-08-13 11:42:05 -06:00
aabbb515d6 UI: Use consistent geometry icon color
The grease pencil weight sculpt icon was using a slightly different
shade of blue than the other icons.
2020-08-13 12:13:21 -04:00
0664194497 UI: Simplify more geometry icons
Again, no visual changes, just removed internal vertices where they
were unecessary.
2020-08-13 12:09:20 -04:00
c5519d4b6f Fix T78065: OSL shader compilation fails on macOS 2020-08-13 17:53:48 +02:00
4ff414d40d Merge branch 'blender-v2.90-release' into master 2020-08-13 17:48:41 +02:00
9813778a2d Fix T79591: Liboverride: do not update overrides on missing linked data.
It makes no sense to generate/update overrides from missing (broken
linked) reference data, just keep existing ones unchanged then.
2020-08-13 17:41:33 +02:00
53683dec7d UI: Simplify geometry icons
Many of the icons had lots of interior geometry left over from
subdivision. In these cases we should remove the interior geometry
and leave the object with the modifier for the future.
2020-08-13 10:30:08 -04:00
52e7d0bebe Merge branch 'blender-v2.90-release' 2020-08-13 10:05:20 -04:00
4e103101f7 UI: Add sculpt cloth filter tool icon
This icon mimics the details of the cloth brush icon while using the
frame style extablished for the other "filter" tools.

Differential Revision: https://developer.blender.org/D8467
2020-08-13 10:04:48 -04:00
f66fc94da6 UI: Add sculpt cloth filter tool icon
This icon mimics the details of the cloth brush icon while using the
frame style extablished for the other "filter" tools.

Differential Revision: https://developer.blender.org/D8467
2020-08-13 10:03:44 -04:00
6fe609d4c3 Sequencer: Implement zoom-to-fit view mode
In this mode the preview image is always using the most of the preview
area space: it is scaled to fit, preserving aspect ratio. This makes it
possible to always have maximum of the preview region even after resize
of other areas.

This mode is enabled by default, is available in the View -> Zoom to Fit
menu. It is enabled when View All (Home key) is used, and is disabled
when manual navigation ([panning, zooming) is performed.

There is no versioning code, which means existing files will open as-is,
but new projects will have this option enabled.

Ref T78987

Maniphest Tasks: T78987

Differential Revision: https://developer.blender.org/D8549
2020-08-13 15:24:21 +02:00
0df28e8c20 View2D: Inform region type on current view changes
Allows to hook per-space code which is to be run on view navigation.
This is required to have zoom-to-fit implemented in the sequencer.

There might be more cases where the clalback is to be called from,
but it could be easier to address those on the case-by-case basis
when its needed.
2020-08-13 15:24:21 +02:00
c27123632b View2D: Centralize handling of changes to v2d->cur
Currently there are no functional changes, preparing code to add more
functionality which is to be run from navigation/zoom operators.
2020-08-13 15:24:21 +02:00
4f209fab2c Fix T79082: Softbody self-collision does not work on lattices
Reviewers: zeddb

Differential Revision: https://developer.blender.org/D8562
2020-08-13 14:41:44 +02:00
b89521de21 UVEdit: Fix drawing after recent refactor 2020-08-13 14:27:16 +02:00
a6447ca72d GPU: Fix MSVC warning 2020-08-13 14:20:24 +02:00
d52f28380b GPU: Fix issue with MDI and recent refactor 2020-08-13 14:20:24 +02:00
f349ea5508 GPUDrawList: Fix gl error with drawing without the correct VAO bound 2020-08-13 14:20:24 +02:00
985070b1ce GPUShader: Add more uniform functions 2020-08-13 14:20:24 +02:00
ac60a67b3f Cleanup: GPU: Remove Batch vao cache reset
This is done at drawtime automatically.
2020-08-13 14:20:24 +02:00
efc97b3919 GPUBatch: GL backend isolation
This changes the drawing paradigm a bit. The VAO configuration is done
JIT-style and depends on context active shader.

This is to allow more flexibility for implementations to do optimization
at lower level.

The vao cache is now its own class to isolate the concept. It is this
class that is reference by the GLContext for ownership of the containing
VAO ids.
2020-08-13 14:20:24 +02:00
47bfb0f7ad GPUBatch: Move allocator to backend 2020-08-13 14:20:24 +02:00
9443da6166 GPUBatch: Merge phase and ownership flags and cleanup there usage
Also add new flags to communicate specific behavior to future backend.
2020-08-13 14:20:24 +02:00
e0f5f95e66 DRW: InstanceData: Remove hacks of batch freeing callback
We instead use a handle reference counter on the GPUVertBufs used by
the instancing batches. This make sure that if an update happens on the
GPUVertBuf used to contruct the batch, they will never have the same
memory address than the previously allocated ones (since they are still
pending deletion thanks to the refcounter).

This avoid the linear search to update the GPUBatch in the case a
batch is deleted (which was even a bad option since they could be only
cleared)
2020-08-13 14:20:24 +02:00
157f2a20e6 GPU: Use GPU_vertbuf_create & GPU_indexbuf_calloc instead of manual alloc 2020-08-13 14:20:23 +02:00
00a3c297d2 GPUVertBuf: Add handle refcount
A handle refcount is here to avoid freeing of the GPUVertBuf datablock
if it is still referenced somewhere else.

This does not prevent deleting the actual data. This is to avoid too
much zombie data usage.

This is in order to avoid most hacks inside `draw_instance_data.c`.
2020-08-13 14:20:23 +02:00
93165cbf47 GPUBatch: Remove most use of GPU_batch_draw_advanced()
This is in order to better encapsulate / isolate the drawing code.
2020-08-13 14:20:23 +02:00
de4eb115ac Cleanup: GPUBatch: Remove GL functions from uniform assignment 2020-08-13 14:20:23 +02:00
b0f30bd684 Cleanup: GPUBatch: Move gpu_batch_private.h to CPP header 2020-08-13 14:20:23 +02:00
16b28ff974 Cleanup: GPUShader: Remove unused code 2020-08-13 14:20:23 +02:00
854c999d82 GPUShader: Change shader state tracking to be part of the GPUContext
This remove the use of batch->program and replace it with batch->shader.

This will allow GL abstraction latter.
2020-08-13 14:20:23 +02:00
186abf7d3b GPUBatch: Remove usage of gl_prim_type outside of GPU module 2020-08-13 14:20:23 +02:00
38ef35b1ed GPUDrawList: GL backend isolation 2020-08-13 14:20:23 +02:00
cb2565195e Fix T65148: Drivers can't access shape keys
It was impossible for drivers to use shape key properties, modifiers
generate a new mesh. After mesh evaluation the shape keys are no longer
necessary, and because of this the `key` pointer was not copied. As
drivers work on evaluated data, however, they do need this `key`
pointer.

This commit makes the `key` pointer available in evaluated meshes, but
this is somewhat dangerous. There was an explicit reason why the key on
result was kept at null pointer: to have the evaluated mesh in a
consistent state. Assigning this pointer makes it potentially
inconsistent, as the evaluated mesh and the original shape key may have
different topologies.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D7785
2020-08-13 13:56:41 +02:00
46aa302400 Merge branch 'blender-v2.90-release' 2020-08-13 11:50:07 +02:00
ada98869df Preferences: correct property description for keyitem restore
Spotted while checking T79657.

Reviewers: brecht

Differential Revision: https://developer.blender.org/D8517
2020-08-13 11:44:57 +02:00
0843d5b024 Fix T79743: baking still uses cage object after removal 2020-08-13 11:30:56 +02:00
28c1300115 Fix T79653: Change soft min frame start of cache from 1 to 0
It was always possible to set it to zero by typing in the value.
This new soft limit is more consistent with the fluid cache
and the Scene.frame_start property.
2020-08-13 11:03:05 +02:00
7c380119a7 GPencil: Remove unused parameter and fix warning 2020-08-13 08:39:46 +02:00
29c28ac022 Cleanup: incorrect comment wrapping
Missed this comment when updating fix for T77409.
2020-08-13 16:38:01 +10:00
e84ffae7ba Cleanup: warnings 2020-08-13 16:23:43 +10:00
357547b010 Cleanup: spelling 2020-08-13 16:21:10 +10:00
608ec79bc3 Cleanup: clang-format 2020-08-13 16:01:38 +10:00
38b5f56dad Merge branch 'blender-v2.90-release' into master 2020-08-13 15:46:55 +10:00
f875d3e504 Merge branch 'blender-v2.90-release' into master 2020-08-13 15:46:46 +10:00
ad05e1100f Fix T77409: Crash showing vertex/face duplicators in edit-mode
This was a regression in deaff945d0 which skips copying a mesh.
Dupli-verts/faces were not updated to account for this.

This supports iterating over edit-mesh vertices & faces,
since falling back to a full copy (as we do in some places)
will be slow while transforming geometry.

This commit looks as if it would change behavior with orcos,
since any edit-mesh deformation causes them to be assigned.
However in practice there is no functional change, details in comments.
2020-08-13 15:41:57 +10:00
9bf8b6799d Cleanup: remove two sided face check
Two sided faces aren't supported and would cause many issues elsewhere.
2020-08-13 15:41:57 +10:00
ee909783de Cleanup: use 'inst_ob' variable name for consistency
Dupli verts/faces named these arguments differently.
2020-08-13 15:41:57 +10:00
494560f19d Cleanup: remove unused struct members from dupli-face/vert
Replace the evaluated mesh with VertexDupliData.mvert since only
vertices are used. This makes dupli-vert similar to how dupli-face
was already working.
2020-08-13 15:41:57 +10:00
a45f2fd1fb Cleanup: move mesh access for dupli vert/face into shared function
De-duplicate mesh access & comments.
2020-08-13 15:41:57 +10:00
12c24ecf6e Cleanup: pass normal as a float to dupli-vert function
Needed for supporting edit-mode dupli-verts.

Currently the un-scaled short values are used to avoid
changing behavior (noted in comments).
2020-08-13 15:41:57 +10:00
51a461dcab Cleanup: spelling, use full sentences for object_dupli.c 2020-08-13 15:41:52 +10:00
f0285e347e Cleanup: use const for dupli vert/face, 'r_' prefix for return value
Make it obvious which values are used read-only, which are written to.
2020-08-13 14:03:46 +10:00
536b6b6376 Merge branch 'blender-v2.90-release' 2020-08-12 21:04:19 -04:00
pembem22
bb2908472c UI: Fix curve widget fill artifacts
Disable antialiasing which caused artifacts.

Differential Revision: https://developer.blender.org/D8497
2020-08-12 21:02:05 -04:00
579cb774da Fix hair collision error introduced in recent commit 2020-08-12 18:40:48 -03:00
5319eb36a5 Cleanup: Silence some arithmetic overflow warnings 2020-08-12 18:25:45 -03:00
c5e469a3e4 Cleanup: Move definitions of some variables closer to their use 2020-08-12 18:25:45 -03:00
7d16db417b Cleanup: move assignment out of loop 2020-08-12 18:25:45 -03:00
6d9358d453 Cleanup: Rename variable 'cloth1' to 'cloth' 2020-08-12 18:25:45 -03:00
ca827e36ac Fix Boundary Brush symmetry with no constant falloff
When using constant falloff symmetry was working fine because the same
deformation is applied twice on the same vertices. When using no
constant falloffs, the deformation is different between symmetry passes,
so vertices need to be separated by symmetry areas to get the right
deformation from its symmetry pass without being overwriten by the next
one.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D8541
2020-08-12 23:07:52 +02:00
1260baf16b GPencil: Remove unused variable and fix memory leak
This was missing in previous commit
2020-08-12 23:07:27 +02:00
c77bf95221 Sculpt: Boundary Brush Falloff Types and Offset
This adds the boundary_falloff_type and boundary_offset to control how the
falloff of the Boundary Brush is applied.

Boundary Origin Offset is the same concept as the Pose Origin offset in
the Pose Brush. It is a multiplier that adds extra length to the brush
radius to locate the deformation pivot further from the boundary without
affecting the falloff.

The Falloff type includes Constant (previous default), brush radius, loop
and loop and invert. Loop and Loop and Invert can be used to create
deformation patterns in a mesh.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D8526
2020-08-12 23:06:42 +02:00
db7cfd03b0 GPencil: Remove unused parameter in convert curve
The only_stroke parameter is not used
2020-08-12 22:48:19 +02:00
e188a798c6 GPencil: Clean material list when convert a curve
Now the list of materials is cleanup and any duplicated material is removed.
2020-08-12 22:48:14 +02:00
cd49c7b5ea GPencil: Move merge similar materials code to BKE
This is required in other places and need to be shared.
2020-08-12 22:48:10 +02:00
01636ed159 GPencil: Fix unreported problem in merge similar materials
When two similar colors were adjacent, the colors were not merged.
2020-08-12 22:48:06 +02:00
b126e38f6b GPencil: Fix unreported error in merge similar materials
When the color was black, the original value was not initialized and get a NaN value with unexpected results.

Also cleanup code.
2020-08-12 22:48:00 +02:00
3d247abb78 GPencil: Remove unused lines 2020-08-12 22:47:56 +02:00
145445c6b4 GPencil: Recode all material management when convert SVG 2020-08-12 22:47:51 +02:00
504c257dae GPencil: Add Sample parameter to Convert curve
This allows to resample the stroke to avoid too dense geometry.
2020-08-12 22:47:47 +02:00
9abdafe840 GPencil: Add parameters to scale thickness when convert Curves
This parameter allows to scale the thickness.
2020-08-12 22:47:43 +02:00
19cef4073d GPencil: Interpolate thickness when convert Curve to GPencil
The curve was using only the last point radius of the segment. Now, the value is interpolated between start and end points.
2020-08-12 22:47:38 +02:00
54b3168c4a Fix T77424 Overlay: Editmode: Issue with multi edit and in-front option
This is a nice addition to the refactor. Now any combination of in-front
/ not in-front will work in non x-ray edit mode.
2020-08-12 19:57:23 +02:00
f21cdf0d12 Clenaup: Deduplicate cloth collision code
And do the clamp by vertex instead of triangle.
2020-08-12 14:49:59 -03:00
633b0d6d25 Merge branch 'blender-v2.90-release' 2020-08-12 19:26:31 +02:00
ba2d1c8898 Fix T79738: Double Click does not opening folders in File Browser
If the File Browser was used in regular editor mode (e.g. not through an
operation like File > Open), the operator that usually opens files and
directories wouldn't execute. We need to keep two operators for
double-click in the keymap so selecting and opening works in all cases.

Caused by c606044157.
2020-08-12 19:26:04 +02:00
eee88f7cec Merge branch 'blender-v2.90-release' into master 2020-08-12 19:03:32 +02:00
b3165fb8b5 Fix (unreported) glitch when making liboverride of object from IDtemplate.
We need to ensure new override is instantiated in the scene...

Reported by @Severin, thanks.
2020-08-12 19:03:03 +02:00
337b6d0758 Cleanup: Use const for context 2020-08-12 12:59:19 -04:00
1da053956a UI: Category support for instanced panels
This adds support for panel categories to the instanced panel system
used for modifiers and others. The change is pulled from D7997 where
it is needed for FCurve modifiers, but it is unused now.

The change is simple and basically amounts to checking the panel
category where it was overlooked before.
2020-08-12 12:56:10 -04:00
6238eabcd4 Merge branch 'blender-v2.90-release' 2020-08-12 18:50:40 +02:00
54c2c14921 CMake: clarify that the modules are licensed BSD 3-Clause
Many of these are derived from similar modules in the CMake project, which
have this license.

Fixes T79715
2020-08-12 18:49:16 +02:00
655091297f Fix T79736: install_deps.sh failing to download OpenImageIO due to wrong version 2020-08-12 18:38:29 +02:00
478ea4c898 Sculpt: Multires Displacement Eraser Brush
This brush deletes displacement information of the Multires Modifier,
resetting the mesh to the subdivision limit surface.
This can be use to easily delete parts of the sculpt or to fix
reprojection artifacts after applying a shrinkwrap.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D8543
2020-08-12 18:26:56 +02:00
6a95f05d65 deps_builder: Optionally build boost::python
This this adds the option of building boost::python
in the libs builder, in preparation for future
dependencies that require it (ie pyopenvdb)

disabled by default, can be enabled with the
`WITH_BOOST_PYTHON` cmake option.

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

Reviewed by: brecht
2020-08-12 10:17:38 -06:00
240ac779d5 Merge branch 'blender-v2.90-release'
# Conflicts:
#	source/blender/draw/engines/eevee/eevee_motion_blur.c
2020-08-12 18:16:47 +02:00
58a457da3d Fix T79680, T79680: confusing viewport denoise start sample behavior 2020-08-12 18:10:50 +02:00
6f502136c7 Fix T79718: Eevee OpenVDB render error when frames miss part of the grids 2020-08-12 18:10:50 +02:00
77e40708c2 Sculpt: Expose Edit Face Set as a tool
Previously the way to use this operations was using the shortcut Ctrl +
W and Ctrl + Alt + W, which was not very discoverable and it was
limiting the amount of options that can be added to the operator.Now the
same functionality of the operator is available as a tool, which will
make easier to add other editing operations and options without adding
more entries to the keymap.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D8545
2020-08-12 18:09:27 +02:00
bff91b32aa Fix T79706: Delta Transform Animation not working
The object "delta_" rna variables were not added to the depsgraph search
and thus it would not trigger updates of the object during animation
playback.
2020-08-12 18:09:00 +02:00
051f067fb8 Fix T79706: Delta Transform Animation not working
The object "delta_" rna variables were not added to the depsgraph search
and thus it would not trigger updates of the object during animation
playback.
2020-08-12 18:07:29 +02:00
2218b61e8e Fix T79637 Motion blur gives artifacts when changing the camera
DRW_render_set_time is calling RE_engine_frame_set will in turn calls
BKE_scene_camera_switch_update.

To workaround this, we get the original camera object at render init and
get the evaluated version from it after each time change.
2020-08-12 18:06:36 +02:00
879ed5a165 EEVEE: Motion Blur: Fix issue with batch overflowing with VBOs 2020-08-12 18:06:36 +02:00
bea79e0c7b EEVEE: Fix dupli recursion constant 2020-08-12 18:06:36 +02:00
1eab858dbc EEVEE: Rework deformation motion blur
This change how motion data are indexed inside the ghash.
We follow cycles closely now and use evaluated ID pointers.

By removing the hack, it fixes T78561 (No Motion Blur on linked objects)
2020-08-12 18:06:36 +02:00
2b042d885a EEVEE: Motion Blur: Use evaluated object as key to motion data
This fix issues with instanced geometry and modifiers. Since the
depsgraph will duplicate the objects when they have different modifiers,
the evaluated object are garanteed to be unique.
2020-08-12 18:06:36 +02:00
ff4b5d00e4 Cleanup: Remove explicit float casts in sculpt code
Differential Revision: https://developer.blender.org/D8553
2020-08-12 18:04:06 +02:00
010911d722 Clenaup: Rename random_access_init to random_access_ensure
Reviewed By: sergey

Differential Revision: https://developer.blender.org/D8529
2020-08-12 18:02:47 +02:00
9f288490d5 Subdiv CCG: Cleanup, remove redundant casts
If one of the operands of a binary operator a float, integer
operand gets promoted to float as well.

Differential Revision: https://developer.blender.org/D8552
2020-08-12 17:51:15 +02:00
697c449578 Cleanup: Use clamp_f instead of CLAMP in sculpt code
Reviewed By: sergey

Differential Revision: https://developer.blender.org/D8528
2020-08-12 17:49:55 +02:00
2476b31c71 Fix Sculpt Filters operator naming
Reviewed By: sergey

Differential Revision: https://developer.blender.org/D8523
2020-08-12 17:43:14 +02:00
1813a99447 UI: Fix typo "subdivion" -> subdivision
In the Multires panel, use singular Subdivision instead of Subdivisions.
2020-08-12 17:23:56 +02:00
841d779322 Increase hard limit for Remesher octree depth
Adding more precision to help making watertight objects to be printed.

Differential Revision: https://developer.blender.org/D8551
2020-08-12 17:05:04 +02:00
df12e6778a deps_builder: Fix python build on windows
Issue introduced in the boost.cmake cleanup in
rB5c563cd903ddceebfffbb1e86af2b406bbb2c457
2020-08-12 08:40:24 -06:00
b0dc413f4d deps_builder: Cleanup options.cmake for windows
We no longer build the thumbnail dll in the builder
and these variables are no longer used.
2020-08-12 08:26:42 -06:00
84076260da Merge branch 'blender-v2.90-release' into master 2020-08-12 16:25:18 +02:00
5c563cd903 deps_builder: Cleanup boost.cmake on windows
There were some remnants from previous boost::python support
and support for building 32 bit libs on windows, neither are
needed currently.
2020-08-12 08:21:37 -06:00
cfbea0e09d LibOverride and modifiers: Add copying of linked modifiers.
It also enables copying of linked modifiers (generating new local ones).
2020-08-12 16:16:37 +02:00
707c81cd11 Merge branch 'blender-v2.90-release' 2020-08-12 16:05:23 +02:00
21118fb610 Fix T79622: Mesh Filter on a locked Shape crashes
For a locked shapekey, a SculptSession's orig_cos / deform_cos /
deform_imats are not initialized (they only are when
deform_modifiers_active is true -- this in turn is only true for
shapekeys if they are //not// locked [and for deforming modifiers of
course])

We can just update that keyblock with sculpt_update_keyblock() in case
of a locked shapekey

Maniphest Tasks: T79622

Differential Revision: https://developer.blender.org/D8499
2020-08-12 15:53:22 +02:00
6ef58099d4 Merge branch 'blender-v2.90-release' 2020-08-12 15:34:18 +02:00
08286ef8ba Fix T79712: Color Changes do not record in Auto-Key Mode
Caused by rBfffba2b6530.

In above commit, the buttons rnaindex [-1 for entire arrays like colors]
was not used anymore for the entire function body of
`ED_autokeyframe_property` (previously in `ui_but_anim_autokey`).
Replacing the index with 0 (in the array case) is indeed necessary for
`BKE_fcurve_find_by_rna_context_ui`, prior to rBfffba2b6530 this was
taken care of by using `ui_but_get_fcurve` instead [which did this
internally].

But using an index of 0 (instead of -1) for the entire function body of
`ED_autokeyframe_property` fails for the array part later, namely
`insert_keyframe` needs -1 here.
Now just replace the index for //finding the FCurve//, but use the
original for //inserting the keyframe//.

Could be backported to 2.83 LTS.

Reviewers: campbellbarton, sybren

Subscribers:
2020-08-12 15:28:12 +02:00
d6570fcaed Cleanup: compiler warnings 2020-08-12 12:15:01 +02:00
1f8cb90828 Merge branch 'blender-v2.90-release' 2020-08-12 12:12:12 +02:00
Kévin Dietrich
9280fb19e4 Fixes T77882: artifacts rendering OpenVDB volumes with multiple grids in Cycles
The previous algorithm was not using all of the requested grids to build a mesh
around the volume due to limitations regarding the use of a dense buffer to
gather information about the volume's topology. This resulted in artefacts during
rendering.

The mesh generation is now done by merging all of the input grids and using the
resulting grid's topology to create the mesh. The generation of the mesh
is still done in index space as before, and the vertices are converted to object
space by using the merged topology grid indexToWorld transform.

To be able to merge the grids together we have to make sure that their transformation
matrices and their index spaces match, thus, if they do not match we simply resample
the grids. This behaviour should tackle one other limitation of the current algorithm,
which is that only one transformation matrix was used to generate the final mesh.

If we do not have an OpenVDB grid for the requested volume data, we generate
a temporary OpenVDB grid for it.

Differential Revision: https://developer.blender.org/D8401
2020-08-12 11:52:12 +02:00
da95fa8344 Fix UV unwrap not working with only one pinned vertex
Now the one vertex defines the position of the UV chart, while rotation and
shape is still determined automatically.

Initial patch by Willis (wlssirius).

Differential Revision: https://developer.blender.org/D8484
2020-08-12 11:52:09 +02:00
a1a81e3b88 Merge remote-tracking branch 'origin/blender-v2.90-release' 2020-08-12 11:47:59 +02:00
cbb1bb90fd Bump the minimum required version for 2.90
This is particular important because 2.90 will coexist with 2.83 LTS, so
we should warn the users of potential loss of data when going from 2.90
to 2.83 and back.

Differential Revision: https://developer.blender.org/D8488
2020-08-12 11:43:29 +02:00
05cb4cf26e Merge branch 'blender-v2.90-release' into master 2020-08-12 11:13:10 +02:00
d070d33aa3 Cleanup: Use proper bool type and literals for operators poll functions. 2020-08-12 11:11:48 +02:00
4e31b5b173 Fix (unreported) broken Poll function of GPencile mods and ShaderFX operators in liboverride case.
Those where assuming we always get a valid modifier data from context,
which is not always true...

Also  fix similar issue with shortcuts as reported in T79635.
2020-08-12 11:11:48 +02:00
b3702f5918 Fix part of T79635: Disable by default operation on unknown mod from liboverride object.
It is unfortunate that we cannot get active modifier from context when
operator is called from a shortcut, but we'd need an event for this to
work... So for now forbid any modifier operation of liboverride objects
in that case.
2020-08-12 11:11:48 +02:00
00a7113e61 Merge branch 'blender-v2.90-release' 2020-08-12 10:45:42 +02:00
9b58a41a92 Fix T79708: ShapeKey value greyed out
Mistake in rB0e9999a93edd.

Maniphest Tasks: T79708

Differential Revision: https://developer.blender.org/D8539
2020-08-12 10:35:06 +02:00
ec5f392087 Merge branch 'blender-v2.90-release' 2020-08-11 22:18:39 +02:00
2c7394acce Cleanup: Reduce indentation level
Check the simpler case first and return early.
2020-08-11 16:17:11 -04:00
90b8df8a99 Cleanup: Remove unecessary variables 2020-08-11 16:14:26 -04:00
dbf5bb7af2 Fix T79640: "Assign Shortcut" doesn't work for "View 2D Zoom"
'VIEW2D_OT' operators were not respected in WM_keymap_guess_opname().
This was seemingly done on purpose (see comment "Op types purposely
skipped  for now"), but dont really see the reason for doing so.

Since the "View2D" keymap is not bound to a specific spacetype, we can
still find it using WM_keymap_find_all() [and passing 0 as spacetype].

Reviewers: Severin

Subscribers:
2020-08-11 22:06:15 +02:00
18b1d1af95 Cleanup: Use sizeof first in allocations 2020-08-11 15:58:04 -04:00
185ed9980c Merge branch 'blender-v2.90-release' 2020-08-11 21:52:54 +02:00
3eebdf8a2d Cleanup: Reduce indentation level
Exit early if the bevel width is zero instead of putting
the main function in an if statement.
2020-08-11 15:51:24 -04:00
2fc2a0a56b Fix T79700: skin modifier: prevent error for vert-only mesh
Vert-only mesh is valid input for the skin modifier (displays isolated
cubes), prevent error message about missing root vertex in that case.

Maniphest Tasks: T79700

Differential Revision: https://developer.blender.org/D8533
2020-08-11 21:41:52 +02:00
29852cf320 Merge branch 'blender-v2.90-release' 2020-08-11 21:25:18 +02:00
aec0cfaf08 Fix T79676: Video Sequencer image sequence strip source path breaks when
saving with 'Remap Relative' option

Caused by rBf7386b97571e.

Logic in BKE_bpath_traverse_main calls the callback multiple times [as
often as there are images in the strip].

Prior to above commit, the callback was
'bpath_relative_convert_visit_cb' [this one did not have this problem -
since it returned early if the path was already made relative once]

After rBf7386b97571e though, the 'bpath_relative_rebase_visit_cb' is
used [this one should not be entered multiple times, it would modifiy the
directy again and again].

Luckily, we have a flag (BKE_BPATH_TRAVERSE_SKIP_MULTIFILE) that can be
used to prevent this (this will take care of only calling the callback
once in BKE_bpath_traverse_main for the VSE case)

Could be backported to 2.83 I think.

Maniphest Tasks: T79676

Differential Revision: https://developer.blender.org/D8536
2020-08-11 21:21:40 +02:00
7e9f47c06c Cleanup: Reduce scope of variable declarations in bmesh_bevel.c
This commit generally moves variable declarations to the smallest scope
the variables are used in. This makes the code more readable by
making it clearer when variables are used and by removing the block
of variable declarations at the top of each function.
2020-08-11 15:08:04 -04:00
b0485d47ef Cleanup: Resolve clang tidy warning / error 2020-08-11 14:58:01 -04:00
2b6d4325ac Merge branch 'blender-v2.90-release' 2020-08-11 20:07:20 +02:00
74556a5a17 Fix T79703 EEVEE: Crash on Macos due to lightcache baking 2020-08-11 20:07:03 +02:00
7219abc5bd Fix T79672 EEVEE: Motion blur steps value broken after recent change
Was just an issue of `taa_render_sample` being reset to 1 when it shouldn't.
2020-08-11 20:07:03 +02:00
cae4041878 Fix T79683: Dim GPencil points created by modifiers
This change makes the generated points a light dimmer than selectable points.

Before:

{F8765593}

After:
{F8765585}

Maniphest Tasks: T79683

Differential Revision: https://developer.blender.org/D8515
2020-08-11 19:13:15 +02:00
48c0a82f7a Sculpt: Option to not modify hidden Face Sets in Face Sets Edit
This options allows to perform Face Sets operations while preserving the
mesh visibility. Edit hidden face sets is enabled by default in order to
expand the visible area of the mesh with the grow/shrink operator, but
this can be changed in the keymap per edit operation as more operations
are supported.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D8029
2020-08-11 19:04:37 +02:00
b95aa48156 Merge branch 'blender-v2.90-release' into master 2020-08-11 18:49:17 +02:00
d2c150772a Fix T79692: Full copy of scene makes Blender freeze if there is content directly in the master collection.
Old and new collections are the same data in Master collection case
here, so we cannot consider the `gobject` listbase of `collection_old`
as always immutable.
2020-08-11 18:46:47 +02:00
20ca7122f0 install_deps: update some libs, and various improvements/fixes.
This commits:
- Updates some libraries to latest officially supported versions:
** Numpy: 1.17.5
** OCIO: 1.1.1
** OIIO: 2.1.15
** OSL: 1.10.10
** OIDN: 1.2.1

- Re-enables some distro packages (like OSL, OIIO, OCIO...).

- Add missing 'CMake cleanup commands' for generated CMake update
  command, for Embree, OIDN and OpenXR.

- Generalizes using min/max versions of accepted libraries, if no
  package can be found in specified range then it is built from sources.

The later point should help keeping things a bit in better conditions,
although current maximal accepted versions are somewhat arbitrary guess
currently.
2020-08-11 18:11:45 +02:00
72b9d0de51 Cleanup some building errors with ClangTidy. 2020-08-11 18:11:45 +02:00
11509c14c3 Fix T75588: Missing loop cuts preview for edges without quads
The preview of points was only done when the edge is wire.

Now the preview of points is done when the edge is not connected to any
quad.

Also to avoid edge slide in this case, all new vertices created in this
specific case are not selected.

Differential Revision: https://developer.blender.org/D7457
2020-08-11 13:02:37 -03:00
304f0f56c5 Merge branch 'blender-v2.90-release' into master 2020-08-11 17:52:12 +02:00
c300a994b1 Merge branch 'blender-v2.90-release' 2020-08-11 17:00:50 +02:00
eca062b9cb Fix T79563: Compositor's Stabilize 2D in invert mode does not work correctly
Is not only the values of translation/scale/rotation which are to be inverted,
but also the order of operations.

Differential Revision: https://developer.blender.org/D8518
2020-08-11 17:00:30 +02:00
e84e6e12ed Fix T79616: Sort by column in filebrowser is broken
After changes in rBc606044157a3, mouse press events would be blocked by
the selection operator. This only worked by chance before.
2020-08-11 16:55:35 +02:00
a3af59f8e3 Merge remote-tracking branch 'origin/blender-v2.90-release' 2020-08-11 16:14:15 +02:00
1c294fb1fd Revert "Fix T77409: Crash showing vertex/face duplicators in edit-mode"
This reverts commit 9adedb2605. It changes
how duplis work, and by that altered how Alembic and USD files are
written. This was signalled by a failing Alembic unit test.
2020-08-11 16:12:44 +02:00
90baead979 GPencil: Split Primitive operators and add number of points to Topbar
Now the operators are split to define different default values. This is also required for the future Bezier primitive tools.

This allows to show in the Topbar the number of subdivisions. Before this value was totally hidden and it was number of Edges. The wheelmouse can be used to override the value while running, but does not change the default value.

{F8766270}

All operators share same code.

Also, fixed some bad practices done with Toolbar in python.

Reviewed By: mendio, pepeland

Differential Revision: https://developer.blender.org/D8506
2020-08-11 15:27:07 +02:00
344a6a4b80 Cleanup: rename variables 'gizmo_snap' to 'snap_gizmo'
And a minor fix when there is no `USE_SNAP_DETECT_FROM_KEYMAP_HACK`.
2020-08-11 10:08:43 -03:00
24c2c488e7 Merge branch 'blender-v2.90-release' into master 2020-08-11 21:48:51 +10:00
023151868f Merge branch 'blender-v2.90-release' into master 2020-08-11 21:48:46 +10:00
18c9f7ef72 Fix T79517: Data Transfer modifier fails in edit-mode 2020-08-11 21:48:02 +10:00
6b573d9877 Fix mesh data-transfer tracking if a change was made 2020-08-11 21:48:02 +10:00
d8d4c8b6cc Fix compile error after recent cleanup 2020-08-11 13:36:14 +02:00
e738d0ec6c Merge branch 'blender-v2.90-release' into master 2020-08-11 13:32:41 +02:00
e11aa3eddd Python: don't remove existing context overrides when calling an operator
Reviewers: campbellbarton, brecht

Differential Revision: https://developer.blender.org/D8532
2020-08-11 13:32:07 +02:00
6d888133da Timers: set first window as context in timer
This avoids some crashes when running Python code in timers.

Reviewers: brecht

Differential Revision: https://developer.blender.org/D8531
2020-08-11 13:24:52 +02:00
1b8778e314 Cleanup: Strict compiler flags
Mainly caused by moving tests to source folder, which brings
new compiler flags.

Also, no need to extend include directories (to the non-existing paths,
btw) since this is done by the CmakeList.txt which is in the blenlib folder.
2020-08-11 12:48:33 +02:00
aa4fb22cac Depsgraph: Use UUID to match modifiers
Solves possible pointer-based comparison fiasco.

Another nice outcome of this is that topology cache will now be
preserved throughout the undo system. For example, undo of object
transform will not require topology cache to be re-created.

Differential Revision: https://developer.blender.org/D8493
2020-08-11 12:17:22 +02:00
6f99dfc0c6 Modifier: Maintain per-modifier session UUID
Allows to keep track of modifiers, which is required, for example,
for runtime data preservation in depsgraph.
2020-08-11 12:17:13 +02:00
ca2c4907fb Fix path regression test build failure on Windows
The file was including BKE. It was a required fix for another
compilation error a while back. It is a bad level include, and
seems is not needed anymore.
2020-08-11 10:36:21 +02:00
15abd58b15 Merge branch 'blender-v2.90-release' into master 2020-08-11 17:11:22 +10:00
bb5cc3bccf Fix memory leak setting error text in the data-transfer modifier 2020-08-11 17:10:36 +10:00
90c6a38cbb Merge branch 'blender-v2.90-release' into master 2020-08-11 16:36:05 +10:00
77c4ed1d04 Merge branch 'blender-v2.90-release' into master 2020-08-11 16:34:50 +10:00
fb049a7976 Merge branch 'blender-v2.90-release' into master 2020-08-11 16:34:39 +10:00
9adedb2605 Fix T77409: Crash showing vertex/face duplicators in edit-mode
Support duplicators in edit-mode without creating a mesh copy.
2020-08-11 16:21:19 +10:00
23a6b5d91e BMesh: add UV calculate center call
Move uv_poly_center to BM_face_uv_calc_center_median as
it was only defined in uvedit_intern.h
2020-08-11 15:11:31 +10:00
fc5ff99770 Cleanup: use doxy sections for object_dupli.c 2020-08-11 14:57:20 +10:00
7f15120e9c Cleanup: GCC warning in guardedalloc_overflow_test 2020-08-11 13:22:59 +10:00
0c0f972e86 Cleanup: spelling 2020-08-11 13:19:09 +10:00
acd4687063 Merge branch 'blender-v2.90-release' 2020-08-10 23:16:25 +02:00
bc5d144855 Fix T77298: Can't bake texture with multiple objects
The problem here is that the baking code uses tiles to exchange pixel data with
the renderer since a recent-ish refactor, but the code that sent data to the
renderer did not initialize the bake result pixels.

Therefore, when the baking process for the second object started, Cycles
received empty tiles and sent them back as-is if the second object did not
cover them.

By initializing the tiles with the result of the previous bakes, we avoid this
problem.
2020-08-10 22:54:01 +02:00
784adccf47 Merge branch 'blender-v2.90-release' 2020-08-10 18:30:53 +02:00
8ef05d3180 Fix T79636: Inserting special characters with Ctrl+Alt broken on Windows
We can't exactly follow what we do for macOS here. On Windows special
characters can be inserted with Ctrl+Alt. So make sure we expect UTF-8
characters when Alt is held.

Mistake in 87062d4d67.
2020-08-10 18:29:02 +02:00
3b08cb3236 Cleanup: follow code style regarding braces 2020-08-10 18:18:59 +02:00
c521b69ffb BLI: improve StringRef for C++17
Since C++17 there is also std::string_view, which is similar to StringRef.
This commit does a couple of things:
* New implicit conversions between StringRef and std::string_view.
* Support std::string_view in blender::DefaultHash.
* Support most of the methods that std::string_view has.
* Add StringRef::not_found which can be used instead of -1 in some places.
* Improve/fix the description at the top of BLI_string_ref.hh.
2020-08-10 18:17:07 +02:00
53d203dea8 Tests: move remaining gtests into their own module folders
And make them part of the blender_test runner. The one exception is blenlib
performance tests, which we don't want to run by default. They remain in their
own executable.

Differential Revision: https://developer.blender.org/D8498
2020-08-10 18:14:00 +02:00
af77bf1f0f Sculpt: Option to mask front faces only using Lasso and Box Mask
This adds a property that checks the normals of each vertex against the
view direction to decide if they should be masked (similar to the
"Front Faces Only" option works for brushes.

Reviewed By: sergey

Maniphest Tasks: T77637

Differential Revision: https://developer.blender.org/D8448
2020-08-10 18:10:45 +02:00
ed9c0464ba Sculpt: Boundary Brush
This brush includes a set of deformation modes designed to deform and
control the shape of the mesh boundaries, which are really hard to do
with regular sculpt brushes (and even in edit mode). This is useful
for creating cloth assets and hard surface base meshes.

The brush detects the mesh boundary closest to the active vertex and
propagates the deformation using the brush falloff into the mesh.
It includes bend, expand, inflate, grab and twist deform modes.

The main use cases of this brush are the Bend and Expand deformation
modes, which depend on a grid topology to create the best results.
In order to do further adjustments and tweaks to the result of these
deformation modes, the brush also includes the Inflate, Grab and
Twist deformation modes, which do not depend that much on the topology.

Grab and Inflate are the same operation that is implemented in the
Grab and Inflate tools, they are also available in the boundary brush
as producing deformations with regular brushes in these areas is very
hard to control.

Even if this brush can produce deformations in triangle meshes and
meshes with a non-regular quad grid, the more regular and clean the
topology is, the better. Most of the assets this brush is intended to
deform are always created from a cylindrical or plane quad grid, so it
should be fine. Also, its algorithms can be improved in future versions
to handle more corner cases and topology patterns.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D8356
2020-08-10 18:04:00 +02:00
71639cc862 Merge branch 'blender-v2.90-release' 2020-08-10 17:40:42 +02:00
9c093a5d9a Fix T79324: Crash when changing View Layer while VR session runs
Proper handling of View Layers for the VR session was never implemented.
Now the View Layer of the VR session follows the window the session was
started in.
Note that if this window is closed, we fallback to another window. This
is done to avoid the overhead it would take to maintain a separate
depsgraph for the VR view. Instead we always share some already visible
View Layer (and hence the depsgraph).
2020-08-10 17:39:36 +02:00
01537f7a9d Merge branch 'blender-v2.90-release' 2020-08-10 12:06:33 -03:00
c0340ec893 Fix T78113: Random explosions of cloth with self collision
The problem is caused by a lack of prediction in the `isect_line_segment_tri_v3`
that incorrectly confirms some intersections of coplanar segments to the triangle.

The solution is to use another algorithm to detect intersections.

This also resulted in a slight improvement in the performance:
- 1min 17sec to 1min 6sec in my test file

Differential Revision: https://developer.blender.org/D8500
2020-08-10 12:05:37 -03:00
1baba83bb0 GPencil: Fix warning text 2020-08-10 16:41:15 +02:00
4ada290956 GPencil: Invert Filled area pressing Ctrl key
This feature was suggested in https://blender.community/c/rightclickselect/rggbbc/

When press `Ctrl+LMB`, the filled area is inverted.

{F8749306}

{F8749307}

Filling several areas:

{F8759399}

Differential Revision: https://developer.blender.org/D8477
2020-08-10 16:34:26 +02:00
3fe2fceb4e GPencil: Change default Stroke thickness when convert curves
The thickness by default was using the old Draw Engine values and it was too thick in new engine.
2020-08-10 15:33:16 +02:00
3a3dc45e7b GPencil: Remove color conversion when convert curve
In previous versions, grease pencil used sRGB and a color conversion was needed, but now all is Linear and the conversion changes the color wrongly.
2020-08-10 15:33:09 +02:00
cfba3cb121 Merge branch 'blender-v2.90-release' into master 2020-08-10 14:35:22 +02:00
ab2dbafd8b Fix T77847: "Add plane > align" causes crash when certain rigs are in the scene (2.83, fixed in 2.90).
Root of the issue was not fixed in 2.90, only hidden by the fact that we
now re-read much less data during undo's that we used to, when some new
datablock gets added or removed.

This is not an ideal solution (as usual when dealing with data pointers
shared across data-blocks), but it's decent enough. thanks a lot to
@brecht for it!

To be backported to 2.83 too.
2020-08-10 14:34:55 +02:00
659f7f1981 Merge branch 'blender-v2.90-release' 2020-08-10 13:52:39 +02:00
2e5c877056 Fix pose offset on VR session start for some OpenXR runtimes
We want the session to start exactly at the landmark position, with
no additional offset. Some runtimes (e.g. Windows Mixed Reality) may
give an initial non-[0,0,0] position at session start though.

Also add a comment explaining the purpose of the eye offset variable.
2020-08-10 13:52:13 +02:00
f1cb3dfbaa Fix broken behavior on active VR Landmark change
There would always be an unintended offset applied. Per design there
should not be any offset when changing VR Landmarks, the view should
just jump exactly to the Landmark.

Due to the recent changes, we don't have to add, but substract the eye
offset we apply to get the wanted behavior.

Mistake in 607d745a79.
2020-08-10 13:51:43 +02:00
9c1f140a47 Fix pose offset on VR session start for some OpenXR runtimes
We want the session to start exactly at the landmark position, with
no additional offset. Some runtimes (e.g. Windows Mixed Reality) may
give an initial non-[0,0,0] position at session start though.

Also add a comment explaining the purpose of the eye offset variable.
2020-08-10 13:49:34 +02:00
727a744e3c Fix broken behavior on active VR Landmark change
There would always be an unintended offset applied. Per design there
should not be any offset when changing VR Landmarks, the view should
just jump exactly to the Landmark.

Due to the recent changes, we don't have to add, but substract the eye
offset we apply to get the wanted behavior.

Mistake in 607d745a79.
2020-08-10 13:40:11 +02:00
342a6b5f93 Fix T77685: object transforms from rigid body simulation are ignored by modifiers
This does not fix all the cases in the bug report, because there are multiple
different issues. Only the first two are fixed. The third is probably a known
issue for now.

Before this patch, the rigid body simulation was always done after modifiers
are evaluated, because to perform the simulation, the final geometry of the
object was required. However, the geometry is not required in all cases,
depending on the selected collisions shape.

This patch changes it so that when the simulation does not need the
evaluated geometry, the simulation will be done before the modifiers
are evaluated. This gives the modifiers access to the simulated positions.
When the rigid body simulation does depend on the evaluated geometry,
it will still be performed after modifiers are evaluated.

The simulation will be performed after modifiers are evaluated, iff
the collision shape is "Convex Hull" or "Mesh" and the source is set
to "Deform" or "Final".

Reviewers: sergey

Differential Revision: https://developer.blender.org/D8487
2020-08-10 10:54:28 +02:00
52a57af3d5 Cleanup: use doxy sections for object_dupli.c 2020-08-10 18:30:47 +10:00
f15d33d585 Fix T79619: Sequencer window not updating whilst playing animation
Reverted Playhead optimizations for VSE. Needs more investigation to
detect which settings in the VSE would require a redraw of the area.
2020-08-10 09:28:18 +02:00
e2d5e8d584 Merge branch 'blender-v2.90-release' 2020-08-10 09:09:49 +02:00
6640ed92c0 Fix T79346: VSE custom proxy file is broken
In last set of refactoring patches, code implementing this feature
has been accidentally removed.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D8449
2020-08-10 08:11:09 +02:00
Eitan
4fd73e7465 Remove Video Proxy Resolution limitation
Height and width of video proxies was limited to multiples of 8 with
comment "JPEG requires this".

I could not find any resource that would confirm this to be the case
with FFMPEG and MJPEG codec.

I have looked in:
https://ffmpeg.org/ffmpeg-all.html
https://ffmpeg.org/ffmpeg-formats.html
https://ffmpeg.org/doxygen/trunk/structAVCodecContext.html

Reviewed By: ISS, sergey, sybren

Differential Revision: https://developer.blender.org/D6507
2020-08-10 07:54:51 +02:00
00162e6b7b Fix T79246 GPUShader: compile error on AWS Elastic Graphics 2020-08-09 14:07:00 +02:00
b522e834ec msvc: Fix build error with msvc 2017
`using blender;` Was required to get the Vector type.
2020-08-08 18:04:46 -06:00
a1d57e3f05 Cleanup: replace sizeof division with ARRAY_SIZE macro 2020-08-08 14:08:37 +10:00
171e77c3c2 Cleanup: use array syntax for sizeof with fixed values
Also order sizeof(..) first to promote other values to size_t.
2020-08-08 13:38:00 +10:00
4bf3ca2016 Cleanup: replace elem_strcmp with elem_streq
This is used for equality and didn't have the same behavior as strcmp.
2020-08-08 13:38:00 +10:00
61a045b7d3 Clenup: use STREQ macro 2020-08-08 13:38:00 +10:00
586a308467 Cleanup: remove redundant return parenthesis 2020-08-08 13:37:55 +10:00
f1b1a0745f Cleanup: GPU: Change gpu_context_private.h to C++ only header 2020-08-08 03:05:39 +02:00
f742a7ac79 DRW: Fix runtime error: shifting signed 32bits int 2020-08-08 01:46:51 +02:00
cb7ea2ccfb GPUBackend: Add new GPUBackend object to manage GL object allocations
This just set a global object responsible for allocating new objects
in a thread safe way without needing any GPUContext bound to this
thread.

This also introduce the GLContext which will contain all the GL related
functions for the current context.

# Conflicts:
#	source/blender/gpu/intern/gpu_context.cc
2020-08-08 01:30:33 +02:00
1dd7377596 GPUBackend: Add new GPUBackend object to manage GL object allocations
This just set a global object responsible for allocating new objects
in a thread safe way without needing any GPUContext bound to this
thread.

This also introduce the GLContext which will contain all the GL related
functions for the current context.
2020-08-08 01:16:40 +02:00
0ccf3f89d2 GPU: Move ghost default framebuffer getter to context creation 2020-08-08 01:15:28 +02:00
0255f1e022 GPUBatch: Use custom allocator
This is needed for the new GPU abstraction.
2020-08-08 01:15:27 +02:00
0063d1befc DRW: Instance Data: Replace GPUBatch bulk allocation by separate alloc
This is suboptimal but needed for the new GPU abstraction.

Maybe a better solution will be needed if performance is impacted.
2020-08-08 01:15:27 +02:00
994ab8985b Cleanup: Fix reported clang-tidy code-style issues.
This resolves `error: statement should be inside braces` in some
windows specific code that previously was unchecked by clang-tidy.
2020-08-07 14:53:42 -06:00
915cc956ba Cleanup: Rename soops to space_outliner
No functional changes. Rename soops, soutliner, and so to
space_outliner.
2020-08-07 11:49:58 -06:00
2597c12b0c Cleanup: Remove outliner statement with no effect
No functional changes. The memory dupalloc will already carry over the
flags.
2020-08-07 11:49:57 -06:00
dc5c616cca Cleanup: use _fn for outliner callback functions
No functional changes.
2020-08-07 11:49:57 -06:00
e3f369e13f Cleanup: fix some clang tidy warnings 2020-08-07 19:19:38 +02:00
c50e5fcc34 Cleanup: use C++ style casts in various places 2020-08-07 18:42:21 +02:00
28b1022434 Fix compile error with WITH_INPUT_NDOF after last own commit
Caused by dcff28e1e7.
2020-08-07 18:41:15 +02:00
ad6e63cb96 Cleanup: enable Clang-Tidy bugprone-parent-virtual-call rule
I added a single `NOLINT` exception with explanation.

No functional changes.
2020-08-07 17:59:26 +02:00
dcff28e1e7 UI Code Quality: Use derived struct for HSV Cube buttons
For the main rationale behind this design, see 49f088e2d0. Further,
this removes users of uiBut.a1, which is a very ugly design
choice (hard to reason about).

Part of T74432.
2020-08-07 17:46:58 +02:00
60b42ef117 Cleanup: enabled Clang-Tidy bugprone-suspicious-missing-comma rule
No functional changes because no code changed.
2020-08-07 17:46:32 +02:00
ca85da075b Cleanup: enabled Clang-Tidy bugprone-not-null-terminated-result rule
No functional changes because no code changed.
2020-08-07 17:38:45 +02:00
a9c91ce331 Cleanup: fixed Clang-Tidy bugprone-suspicious-string-compare warnings
No functional changes.
2020-08-07 17:16:49 +02:00
7309ee4df7 Merge branch 'blender-v2.90-release' 2020-08-07 17:12:00 +02:00
a93be410c9 Fix previous commit, we first need to be sure we actually get a mesh... 2020-08-07 17:11:21 +02:00
c4b1ef45a0 Merge branch 'blender-v2.90-release' 2020-08-07 17:08:44 +02:00
8fa42f0bd4 Fix T79604: Switching to edit mode on boolean object runs out of memory.
Note that this is a dummy safe fix for now, far from optimal.
2020-08-07 17:07:30 +02:00
be83b8f456 Cleanup: CMake warnings related to "find package" modules
Fix package name missmatch in a few module files. IE "ALEMBIC" was
defined in the file but the find_package commands used "Alembic"

Some modules state that they set and use the _LIBRARY variable but the
do in fact not do this. Removed these comments from those files.
2020-08-07 16:56:38 +02:00
4c2ce816aa Cleanup: enabled Clang-Tidy rule bugprone-infinite-loop
Enabling it and doing a full rebuild didn't cause any warnings, so nothing
else to do here.

No functional changes.
2020-08-07 16:46:26 +02:00
7aeab6f6aa Cleanup: added explanation of why incircleadapt is allowed to be long
This is a followup of d4bd0789ab, as it was
lacking a bit of an explanation.

No functional changes.
2020-08-07 16:38:28 +02:00
6414da0381 Cleanup: enable and silence Clang-Tidy readability-function-size
Enable Clang-Tidy's `readability-function-size` rule and add a few
`NOLINT` markers to explicitly silence warnings for three functions.
These functions are huge and would IMO benefit from splitting up, but
are hard to without intimate knowledge of the code.

At least by enabling the rule, we can start tweaking the values and
refactoring other functions that bubble up as being too long/complex.

No functional changes.
2020-08-07 16:23:17 +02:00
2a0bc4d23e Cleanup: Nodes, silence Clang-Tidy readability-function-size
Add a `NOLINT` marker to explicitly silence a warning from Clang-Tidy's
`readability-function-size` rule for the `node_type_base()` function.
This function is indeed huge, but that is because a lot of macros are
expanded. Before expansion things are still not small, but still
understandable & expandable.

No functional changes.
2020-08-07 16:23:02 +02:00
4ce298b3c0 Cleanup: Clang-Tidy. readability-non-const-parameter in pixel drawing 2020-08-07 16:13:11 +02:00
17dbdcc552 Fix T79571: "Assign Shortcut" doesn't work for "Clear Keyframes"
In the 3D View, the "Animation" keymap is not used, but the mode
specific ones. So the shortcut editing code should use these too, just
like the default keymap does.
2020-08-07 16:11:30 +02:00
d4bd0789ab Cleanup: Delaunay 2D, silence Clang-Tidy readability-function-size
This adds a `NOLINT` marker to explicitly silence a warning from
Clang-Tidy's `readability-function-size` rule for the `incircleadapt()`
function in `delaunay_2d.c`.

No functional changes.
2020-08-07 15:54:28 +02:00
b27a953798 Cleanup: Versioning: silence Clang-Tidy readability-function-size
This adds `NOLINT` markers to explicitly silence warnings from Clang-Tidy's
`readability-function-size` rule for versioning functions. Technically
these could be refactored and split up into smaller bits, but generally
they are hardly ever looked at once they're a few releases old.

No functional changes.
2020-08-07 15:54:28 +02:00
3090b52f8c Cleanup: PyBGL, Clang-Tidy readability-function-size fixes
This addresses warnings from Clang-Tidy's `readability-function-size`
rule in the `source/blender/python` module.

It's just `BPyInit_bgl()` that's been split up into one or two smaller
functions per OpenGL version.

No functional changes.
2020-08-07 15:54:28 +02:00
24d8ab1556 Merge branch 'blender-v2.90-release' 2020-08-07 15:50:42 +02:00
c2691c93d5 Fix T79201: Mantaflow: Fluid guides don't affect simulation.
This broke during the OpenVDB update for 2.90. Just making sure that guiding velocity files are being read correctly.
2020-08-07 15:33:51 +02:00
076a93b855 UI Code Quality: Use derived struct for progessbar buttons
For the main rationale behind this design, see 03b122e2a18df. Further,
this removes users of `uiBut.a1`, which is a very ugly design
choice (hard to reason about).

Part of T74432.
2020-08-07 15:17:52 +02:00
9f475db6c9 Fix failing assert when entering Texture Paint mode
Was unbinding the shader twice.
2020-08-07 15:17:52 +02:00
68c00e6f8f UI Code Quality: Use derived struct for color buttons
For the main rationale behind this design, see 03b122e2a18df. Further,
this removes users of `uiBut.a1`/`uiBut.a2`, which is a very ugly design
choice (hard to reason about).

Part of Part of T74432.
2020-08-07 15:17:52 +02:00
49f088e2d0 UI Code Quality: Use derived structs for search buttons and decorators
The current on-size-fits-all `uiBut` creates quite a mess, where it's
hard to reason about which members are free for use, under which
conditions they are used and how.
`uiBut` also has members that aren't used at times, violating the "don't
pay for what you don't use" principle.

To address this, we want to move to typed buttons, where `uiBut` is just
a base struct and each type extends it as needed. That structures data
better and type specific data is only available if it's actually used by
a button type.

Two trade-offs:
* Many casts to the derived type have to be done.
* Sometimes we change the button type after it's created. So I had to
  add logic to reallocate the button for use with the new, possibly
  derived struct. Ideally that wouldn't be needed, but for now that's
  what we have.

Part of T74432.

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

Reviewed by: Brecht Van Lommel, Campbell Barton
2020-08-07 15:17:52 +02:00
48e089375e Cleanup: pass arrays const where possible 2020-08-07 22:56:13 +10:00
b134434224 Cleanup: declare arrays arrays where possible 2020-08-07 22:37:39 +10:00
3db67fd670 Revert "Cleanup: Cycles, applied Clang-Format"
This reverts commit 88cc3f167f. It was
caused by running Clang-Format version 10, instead of 9 from the
precompiled libs directory.
2020-08-07 13:38:07 +02:00
c04088fed1 Cleanup: Clang-Tidy else-after-return fixes
This addresses warnings from Clang-Tidy's `readability-else-after-return`
rule. This should be the final commit of the series of commits that
addresses this particular rule.

No functional changes.
2020-08-07 13:38:07 +02:00
3d48d99647 Cleanup: Python, Clang-Tidy else-after-return fixes
This addresses warnings from Clang-Tidy's `readability-else-after-return`
rule in the `source/blender/python` module.

No functional changes.
2020-08-07 13:38:07 +02:00
44b7354742 Cleanup: Nodes, Clang-Tidy else-after-return fixes
This addresses warnings from Clang-Tidy's `readability-else-after-return`
rule in the `source/blender/nodes` module.

No functional changes.
2020-08-07 13:38:06 +02:00
47f8c444a4 Cleanup: Modifiers, Clang-Tidy else-after-return fixes
This addresses warnings from Clang-Tidy's `readability-else-after-return`
rule in the `source/blender/modifiers` module.

No functional changes.
2020-08-07 13:38:06 +02:00
dee359e26e Cleanup: IO, Clang-Tidy else-after-return fixes
This addresses warnings from Clang-Tidy's `readability-else-after-return`
rule in the `source/blender/io` module.

No functional changes.
2020-08-07 13:38:06 +02:00
dbf4f52fe0 Cleanup: ImBuf, Clang-Tidy else-after-return fixes
This addresses warnings from Clang-Tidy's `readability-else-after-return`
rule in the `source/blender/imbuf` module.

No functional changes.
2020-08-07 13:38:06 +02:00
c889d93c80 Cleanup: GPU, Clang-Tidy else-after-return fixes
This addresses warnings from Clang-Tidy's `readability-else-after-return`
rule in the `source/blender/gpu` module.

No functional changes.
2020-08-07 13:38:06 +02:00
326e137a8c Cleanup: Freestyle, Clang-Tidy else-after-return fixes
This addresses warnings from Clang-Tidy's `readability-else-after-return`
rule in the `source/blender/freestyle` module.

No functional changes.
2020-08-07 13:38:06 +02:00
94eaaf097c Cleanup: Depsgraph, Clang-Tidy else-after-return fixes
This addresses warnings from Clang-Tidy's `readability-else-after-return`
rule in the `source/blender/depsgraph` module.

No functional changes.
2020-08-07 13:38:06 +02:00
f453ee7d3a Cleanup: Compositor, Clang-Tidy else-after-return fixes
This addresses warnings from Clang-Tidy's `readability-else-after-return`
rule in the `source/blender/compositor` module.

No functional changes.
2020-08-07 13:38:06 +02:00
fb18e48a84 Cleanup: Blenloader, Clang-Tidy else-after-return fixes
This addresses warnings from Clang-Tidy's `readability-else-after-return`
rule in the `source/blender/blenloader` module.

No functional changes.
2020-08-07 13:38:06 +02:00
1b272a649b Cleanup: Blenkernel, Clang-Tidy else-after-return fixes
This addresses warnings from Clang-Tidy's `readability-else-after-return`
rule in the `source/blender/blenkernel` module.

No functional changes.
2020-08-07 13:38:06 +02:00
cfc6f9eb18 Clang-Tidy: Address readability-redundant-string-init 2020-08-07 12:18:15 +02:00
156448ba4b Cleanup: Draw, Clang-Tidy else-after-return fixes (incomplete)
This addresses warnings from Clang-Tidy's `readability-else-after-return`
rule in the `source/blender/draw` module. Not all warnings are addressed
in this commit.

No functional changes.
2020-08-07 12:01:40 +02:00
88cc3f167f Cleanup: Cycles, applied Clang-Format
No functional changes.
2020-08-07 12:01:40 +02:00
4ba9d7d71e Fix fast clicks on File Browser sort columns not changing sorting
Clicking on the column header is supposed to enable sorting by this
column, or switch the sort order if already enabled.
The double-click event would be blocked by the `file.execute()`
operator, which is not supposed to act if the user clicked outside the
file list.
2020-08-07 11:39:04 +02:00
5809dc6b5b Fix T79616: Sort by column in filebrowser is broken
After changes in rBc606044157a3, mouse press events would be blocked by
the selection operator. This only worked by chance before.
2020-08-07 11:39:04 +02:00
a29686eeb3 Cleanup: Blenlib, Clang-Tidy else-after-return fixes (incomplete)
This addresses warnings from Clang-Tidy's `readability-else-after-return`
rule in the `source/blender/blenlib` module. Not all warnings are
addressed in this commit.

No functional changes.
2020-08-07 11:23:02 +02:00
e0c51b466f Merge branch 'blender-v2.90-release' into master 2020-08-07 10:23:33 +02:00
1b1129f82a Code Style: use "#pragma once" in intern/ghost
More information can be found in D8466.
2020-08-07 10:18:01 +02:00
8198dbb888 Code Style: use "#pragma once" in some newer headers
Those were missing from the previous commit, because these headers
only exist in the `master` and not in the `blender-v2.90-release` branch.
2020-08-07 10:10:37 +02:00
af88cc0701 Cleanup: make format 2020-08-07 10:07:36 +02:00
7283e6fb73 Merge branch 'blender-v2.90-release' into master 2020-08-07 10:04:57 +02:00
91694b9b58 Code Style: use "#pragma once" in source directory
This replaces header include guards with `#pragma once`.
A couple of include guards are not removed yet (e.g. `__RNA_TYPES_H__`),
because they are used in other places.

This patch has been generated by P1561 followed by `make format`.

Differential Revision: https://developer.blender.org/D8466
2020-08-07 09:50:34 +02:00
21fec95139 Merge branch 'blender-v2.90-release' 2020-08-07 01:23:20 +02:00
58909abc68 EEVEE: Render: Fix regression caused by previous Motion blur fix
Caused by rB4f59e4bddcb0c06e441adf68a5f252a4e5b4b260
2020-08-07 00:59:14 +02:00
6e226275fd Merge branch 'blender-v2.90-release' 2020-08-06 23:06:33 +02:00
4f59e4bddc Fix T78452 EEVEE: Motion Blur: Crash when using camera switching
This was caused by the ViewLayer being freed with all its
engine data.
2020-08-06 23:06:18 +02:00
3dcaca93a0 Fix T78160 EEVEE: Motion Blur: Bug with Follow Path animation
Follow path seems to not be catched by `BKE_object_moves_in_time`.
For this reason, we cache all transforms for all object and check
ourselves if an animation occurs. This is almost what cycles does.

We also fix the rigid body case if the rigid body use deformation.
2020-08-06 23:06:18 +02:00
9a1ff4445b Merge branch 'blender-v2.90-release' 2020-08-06 19:52:49 +02:00
3d35012a05 GPencil: Fix unreported wrong Polyline bottom tooltip
It was mising the Wheelmouse option and the name of the tool was wrong.
2020-08-06 19:52:30 +02:00
6f87a7ad9f GPencil: Fix unreported wrong Polyline bottom tooltip
It was mising the Wheelmouse option and the name of the tool was wrong.
2020-08-06 19:44:41 +02:00
8123b12006 Fix T79586: "rendering paused" not shown when viewport render starts paused 2020-08-06 19:19:22 +02:00
Vincent Blankfield
8fbfc150a0 Fix T77885: crash rendering grease pencil from compositor with multiple scenes 2020-08-06 19:19:22 +02:00
8719ac990f Merge branch 'blender-v2.90-release' 2020-08-06 19:15:35 +02:00
cc3cb52b23 Fix Pose Brush FK mode detecting wrong rotation origin
The Pose FK mode assings the rotation origin to the boundary of the last
visited face set in the floodfill operation. In some cases, the topology
of the model may make the flood fill operation to visit a face set as the
first one (assinging it to target) and visit it again as the last one
(assinging it to origin). This will make the pose brush to default the
origin and target to the brush location and not to the face sets as it
considers that there is only one possible boundary.
This adds a GSet to ensure that a particular face set is not visited
twice in the flood fill, fixing these cases.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D7984
2020-08-06 19:14:39 +02:00
d693d77fed Sculpt: Cloth Brush simulation area property
This makes possible to choose between a local and a global simulation
when the cloth brush is used. Local simulation is the current default.
When global simulation is enabled, the cloth brush simulates the entire
mesh without taking any simulation limits into account.

This was possible before by setting the simulation limits to 10 (the
current maximum value allowed) so the entire mesh was inside the limits,
but this was a hack as the limits scale with the radius and there should
not be any limitation on how big the simulated area can be to be able to
simulate an entire object. This also allows to make a more clear
distinction between cloth brush presets that are intended to be used in
local areas to add details or globally to generate the base shape of the
mesh.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D8481
2020-08-06 18:03:56 +02:00
97c56b7628 Merge branch 'blender-v2.90-release' 2020-08-06 17:29:28 +02:00
96e460ed9b GPencil: Patch old files after the change in how the first frame is used
This patching duplicates the first frame of the layer if the first frame number is not equals to the scene first frame number.

Related to T79567

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

Some minor cleanup in the patch.
2020-08-06 17:28:59 +02:00
5f51438185 Cleanup: Paint Cursor Refactor
The paint_draw_cursor function was handling the cursor drawing for 2D
and 3D views of all paint modes, calculating the brush radius, updating
the SculptSession data and updating and drawing all sculpt cursor
overlays for different tools. It was almost impossible to understand when
and what was being drawn and in which state the GPU matrix was.

Now everyting is organized into different functions, with clear
separation between modes, sculpt tool overlays and different drawing
setups. Update and drawing functions are also separated (this allows to
skip one PBVH query on each cursor drawing).

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D8206
2020-08-06 17:27:57 +02:00
56af04d31f Merge remote-tracking branch 'origin/blender-v2.90-release' 2020-08-06 16:44:21 +02:00
bc8168f4a2 Cleanup: Remove bad level calls from space image
Groundwork for upcoming fix (D8472)
2020-08-06 16:44:03 +02:00
45e6ca3661 Cleanup: Stop accessing gpu_batch_presets_reset()
The current code is accessing this from outside the gpu "namespace". As
such it should be accessing GPU_ functions, not gpu_ functions.

This is also a place to centralize the XXX message that will be
addressed upon refactor. So we can reuse this call in other places that
need the same temporary workaround.

Groundwork for upcoming fix (D8472)
2020-08-06 16:44:03 +02:00
5e6119ddca Cycles: load OpenVDB file earlier in Blender export
In an upcoming bugfix we'll use OpenVDB data structures directly to build mesh
for sparse OpenVDB volumes, loading them OpenVDB grids earlier and removing any
references to Blender data structures makes that easier.

This also makes changes to Blender volumes to support this, so Cycles can take
ownership of a grid without Blender having to keep its own reference to it.
This should also be useful in a future Python API.

Ref D8401
2020-08-06 15:13:05 +02:00
9696239762 Merge branch 'blender-v2.90-release' 2020-08-06 15:05:00 +02:00
77d71cc113 Move CDData debug print helper from DM to CustomData 'namespace'/files. 2020-08-06 15:03:49 +02:00
86f586636d Merge branch 'blender-v2.90-release' into master 2020-08-06 22:58:48 +10:00
30d3d4fbc1 Merge branch 'blender-v2.90-release' into master 2020-08-06 22:58:44 +10:00
Yevgeny Makarov
91be94d465 UI: Fixes and small improvements to some labels and UI messages
Small tweaks to make labels and texts more correct, consistent and
polished.

Reviewed by: Aaron Carlisle, Julian Eisel

Differential Revision: https://developer.blender.org/D8346
2020-08-06 14:50:45 +02:00
e4f400f0d6 Cleanup: undeclared warnings 2020-08-06 22:50:38 +10:00
ba20da7214 Cleanup: avoid debug-only includes for BLI_assert.h
Having includes in debug builds makes it possible to accidentally
break release builds.

Avoid this by moving calls to other modules out of BLI_assert.h
into BLI_assert.c
2020-08-06 22:49:28 +10:00
cb1096163a Merge branch 'blender-v2.90-release' 2020-08-06 14:15:19 +02:00
73a43c9d8a Fix buffer-overflow when drawing Curve Guide objects
Was passing an array of length 3 to `where_on_path()` that expected
length 4.
2020-08-06 14:14:55 +02:00
cb294c3a01 Fix buffer-overflow when drawing Curve Guide objects
Was passing an array of length 3 to `where_on_path()` that expected
length 4.
2020-08-06 14:12:23 +02:00
Matias Herrero
8f34bf5ebb UI: Name force fields using the type of force by default
When adding multiple force fields of different types they are all called
"Field", making it difficult to tell them apart.
Lights were already named based on their type. This follows the light
code.

New names:
  - Force
  - Vortex
  - Magnet
  - Wind
  - Guide
  - TextureField
  - Harmonic
  - Charge
  - Lennard-Jones
  - Boid
  - Turbulence
  - Drag
  - Fluid
  - Field

Reviewed by: Julian Eisel

Differential Revision: https://developer.blender.org/D8420
2020-08-06 14:09:10 +02:00
690d61cf78 Merge branch 'blender-v2.90-release' 2020-08-06 13:39:09 +02:00
574bd866c8 Fix T78520 EEVEE: No viewport update when changing material nodetree
This was comming from rBd82c3d86155ea3c7831c7b5ef5d07bc8e2d99394
2020-08-06 13:37:41 +02:00
c4e606e386 Merge branch 'blender-v2.90-release' 2020-08-06 13:35:06 +02:00
Red Mser
b313710c10 Fix padding when multi-editing aligned widgets
Similar to T58668, labels were not aligned when multi-editing widgets
that are not center-aligned.

Reviewed by: Hans Goudey, Julian Eisel

Differential Revision: https://developer.blender.org/D8441
2020-08-06 13:34:40 +02:00
2d95a23aa6 Merge branch 'blender-v2.90-release' into master 2020-08-06 12:55:49 +02:00
769ec7ffe6 Fix T79408: ungroup operation update animation data incorrectly
Reviewers: sybren, sergey

Differential Revision: https://developer.blender.org/D8464
2020-08-06 12:50:08 +02:00
95fb3dc5ca Depsgraph: refactor dot exporter to use utility library from blenlib
Reviewers: sybren, sergey

Differential Revision: https://developer.blender.org/D8473
2020-08-06 12:40:37 +02:00
Yevgeny Makarov
b2e0c8f902 UI: Reduce item padding in the edit mesh context menus
Align items in the edit mesh context menus (reducing padding), for
consistency with other menus.
The root layout of menus doesn't add the padding, for sub-layouts
`align` has to be enabled.

{F8749633}

Reviewed By: Julian Eisel

Differential Revision: https://developer.blender.org/D8480
2020-08-06 12:33:28 +02:00
d71cb229d0 Fix T79484: Crash when viewing Movie Clip as a Background Image in a Camera
This seems to be caused by a change to the logic of movieclip_get_gputexture_ptr in rB97b597c.

Differential Revision: https://developer.blender.org/D8469
2020-08-06 11:52:59 +02:00
3439cbcc69 Merge branch 'blender-v2.90-release' into master 2020-08-06 19:20:32 +10:00
82150f5641 Workaround release builds failing
Issue caused by e9c4325515.
2020-08-06 19:19:25 +10:00
8a8c3e0972 Merge branch 'blender-v2.90-release' into master 2020-08-06 19:01:07 +10:00
c872e87bd4 Fix T79309: Safe Areas are not visible 2020-08-06 18:59:20 +10:00
6158f56f52 Merge branch 'blender-v2.90-release' into master 2020-08-06 17:19:01 +10:00
d4804f00fb Fix T79575: Crash loading nested set-scenes 2020-08-06 17:15:20 +10:00
14dc1aecf0 Merge branch 'blender-v2.90-release' into master 2020-08-06 15:48:42 +10:00
Daniel Bailey
e9c4325515 Python: include Python stack trace in the crash log
This helps Python developers troubleshoot errors when
Python causes a crash.
2020-08-06 15:44:00 +10:00
c86fed79d5 Cleanup: use doxy sections for py_capi_utils.c 2020-08-06 13:51:28 +10:00
85ddba475b Cleanup: no need for plural for term 'collision' 2020-08-06 09:38:25 +10:00
675700d948 Sculpt: Cloth Brush/Filter Collisions
This implements collisions in the solver of the cloth brush/filter. It
uses the scene colliders as a regular physics simulation.

There are still some parameters (friction, distance to the surface...)
that can be exposed as properties in later patches.

Thanks to Sebastian Parborg for helping me with the implementation.

Reviewed By: sergey, zeddb

Differential Revision: https://developer.blender.org/D8019
2020-08-06 00:29:22 +02:00
8c98684e22 Merge branch 'blender-v2.90-release' 2020-08-05 17:38:48 -04:00
c5b6b3d82f Fix T78698: Move cursor stuck after removing modifier
The panels are rebuilt when a modifier is removed so the button handlers need
to properly finish. By adding a context argument to the panel_delete function
this will happen properly.
2020-08-05 17:36:16 -04:00
3570173d0f Sculpt: Sharpen Mesh Filter curvature smoothing and intensify details
This adds a curvature smoothing and intensify details properties to control
the result of the Sharpen Mesh Filter.

Curvature smoothing removes high frequency details from the precalculated
sharpen data, so the filter result has much smoother surfaces and cleaner
sharpen lines;

Intensify details displaces the vertices of creases and valleys in the direction
opposite to its neighbors average, so it intensifies high frequency details
in those areas, producing more noisy and sharp shapes:

Both this properties can be used in combination to achieve a good balance of
high and low frequency details depending on the shape and the desired result.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D8447
2020-08-05 23:16:42 +02:00
ad3838e1e0 Fix Squash and Stretch naming in the Pose Brush deform mode
Previusly it was using the / character, which implies that there is one
deformation mode and and invert deformation mode like in the other two
deformation, but squash and stretch is only one deformation mode and
does not have an invert mode.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D8463
2020-08-05 23:00:38 +02:00
9ea77f5232 Sculpt: Option to lock the rotation in the Pose Brush scale deform mode
The scale deform mode includes rotation by default, so when when scaling
down a part of the models it becomes harder to control as the effect of
the rotation less predictable (similar to using trackball rotation in a
very small radius). This locks the rotation of the segment, so parts of
the model can be scaled down in a more predictable way.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D8465
2020-08-05 22:59:27 +02:00
3474b0968a Merge branch 'blender-v2.90-release' 2020-08-05 22:29:40 +02:00
59861db763 Fix T77517 EEVEE: Collection Holdout doesn't work in 2.90
The default material was missing its init code.
2020-08-05 22:29:21 +02:00
29ef7142dd EEVEE: Fix previous commit
Small mistake in rB5249a813f22f

Now for fix it real!
2020-08-05 22:18:26 +02:00
2b7d39c3f1 Merge branch 'blender-v2.90-release' 2020-08-05 22:13:15 +02:00
5249a813f2 Fix T78954 EEVEE: Motion Blur: Bug with hair particles on linked objects
The cache key for particle system was the original Object data. But this
is incorrect for particle systems as modifiers are not shared.
2020-08-05 22:12:53 +02:00
492235903d Merge branch 'blender-v2.90-release' 2020-08-05 21:58:03 +02:00
315ae005c3 Fix file name sometimes not visible immediately after renaming
Steps to reproduce were:
* Open File Browser
* Create a new directory
* Cancel renaming with Esc

File selection flags were modified during drawing when the rename button
got removed, but the file name label drawing wasn't checking the
modified state.
2020-08-05 21:57:51 +02:00
f41eb8b2a9 Merge branch 'blender-v2.90-release' 2020-08-05 21:34:15 +02:00
c606044157 Fix double-click not opening directories on some touch-pads
The file.execute() operator is the one that actually opened directories
and files, not file.select() with the "open" option, as it was assumed
when changing the keymap to double-click for opening. It only acts on
the current selection though, so we have to ensure the selection is set
on the first click.
Now, some touch-pads have a delay until they register a click event, so
the double-click would be registered instead, before the selection is
set. Always select on mouse-down now and remove the unnecessary select
operator call on double-click.
2020-08-05 21:34:00 +02:00
82343037f5 Merge branch 'blender-v2.90-release' 2020-08-05 15:48:29 -03:00
Deep Majumder
c323f3e90a Fix T77548: Crash when using Add Object Tool with Normal Orientation and zero objects in scene
The crash is caused by the fact that a NULL Object pointer is passed to
calculate the transform orientation, which has been set to normal.

A check has been include to detect the same.

Differential Revision: https://developer.blender.org/D7951
2020-08-05 15:45:46 -03:00
7aec56204b Merge branch 'blender-v2.90-release' 2020-08-05 20:33:40 +02:00
f3e724b93d Fix T79370 EEVEE: Texture paint does not update during stroke
Was caused by rBd82c3d86155e
2020-08-05 20:33:24 +02:00
854f73b4a2 Fix T78592: Shear operator fails to affect curve control point handles
Use `td->iloc` as the coordinates of the transformed element.

It is more accurate and other transformation modes, such as scale, also
operate on `td->iloc`.
2020-08-05 15:06:23 -03:00
d9b72a96b3 Merge branch 'blender-v2.90-release' 2020-08-05 19:41:04 +02:00
1b593edf1d Fix T78907: Renaming file doesn't work while mouse is over file icon
The icons are label buttons. Usually these are not editable and can not
become active. These are draggable ones though (so dragging files can be
dragged by dragging the icon) which creates an exception to this rule.
So hovering the icon would activate its label and when executing the
rename operator via shortcut it wouldn't get exited properly. This broke
the invariant of only allowing a single active button at a time.
Added an assert to check that invariant now.

Letting the code to activate the text button ensure any currently active
button is exited seems sensible.
2020-08-05 19:40:40 +02:00
38e9a349de Workbench: Fix broken id pass 2020-08-05 19:37:41 +02:00
cf3431e0e8 Fix T79509 Workbench: Object color mode broken if more than 4096 objects
This was due to the new DRWShadingGroup not being saved and reused for
the next objects.
2020-08-05 19:37:41 +02:00
93f4f96818 Merge branch 'blender-v2.90-release' 2020-08-05 20:21:08 +03:00
a316d3b6c6 Eevee: do not rely on the SOCK_HIDE_VALUE flag for node group sockets.
When disconnecting links for defaulted node group inputs, recurse
into the nested node group nodes, instead of checking the socket
flag. Otherwise the behavior is confusing and differs from Cycles.

Differential Revision: https://developer.blender.org/D8455
2020-08-05 20:20:48 +03:00
9118df1ecd Merge branch 'blender-v2.90-release' into master 2020-08-05 10:46:12 -06:00
d84dce85f3 Fix T72297: disabled buttons toggling on drag
Disabled buttons would incorrectly toggle state when a drag toggle
passed over them. This adds a check to prevent a drag toggle on disabled
buttons.

Differential Revision: https://developer.blender.org/D8476
2020-08-05 10:42:43 -06:00
9e644b98a6 GPencil: Reorganize Advanced Brush panel
The Ignore Transparent Strokes and the Factor are related, so it's better disable factor if the checkbox is disabled.
2020-08-05 18:25:58 +02:00
e03d53874d Fix T79127: crash on scene.ray_cast() with non-viewport view layer
The `rna_Scene_ray_cast()` function tried to find the current depsgraph. To
this end, it required the scene, the view layer, and bmain. Scene has a cache
of per-view-layer depsgraphs, to speed up switching between view layers. This
cache does not contain render depsgraphs, and evaluated view layers also don't
have a depsgraph here.

When a suitable depsgraph cannot be found, a new depsgraph is created. However,
this depsgraph is not evaluated, and has an unexpanded scene pointer with a
`NULL` `view_layer`. Using this then crashes Blender. Also, there was no way
for the code to get the render depsgraph.

The solution is to pass the depsgraph to the `ray_cast()` function, instead of
the view layer. This avoids the depsgraph lookup, and also works correctly when
rendering.

Some add-ons also need updating, which I'll do in the `addons`
repository soon.

Reviewed By: Sergey

Differential Revision: https://developer.blender.org/D8475
2020-08-05 18:14:06 +02:00
fff12be945 GPencil: Rename Default Fill Boundary option to All 2020-08-05 18:00:34 +02:00
927b1e9fa2 Merge branch 'blender-v2.90-release' 2020-08-05 17:51:41 +02:00
531a3f6c4e Sculpt: Use vertices instead of faces to limit the grids in each PBVH node
This uses the vertices per grid instead of quads to set the limit of
grids per PBVH Node. This should create more leaf nodes in lower
subdivisions levels where the duplicates count is high, producing more
uniform performance across different levels.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D8454
2020-08-05 17:50:28 +02:00
8fc7c3539a GPencil: Add Fill option to determine the layers used for boundary strokes
This is a patch suggested in https://blender.community/c/rightclickselect/qggbbc/

The valid values are:

* Visible Layers.
* Active Layer.
* Layer Above active.
* Layer Below active.
* All layers Above active.
* All layers Below active.

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

Some minor UI changes done in the original patch.
2020-08-05 17:46:34 +02:00
f3acfc97d9 Functions: fix multi function test
There were two issues. First, I made a mistake when I switched from unsigned
to signed integers. Second, two classes with the same name were defined in
separate files. Those classes are in an anonymus namespace now, so that they
don't leak into other files.
2020-08-05 17:19:02 +02:00
b3d35d2039 Fix Cycles + grease pencil render failing after recent GPU refactoring
GPU_texture_update_sub now requires the texture to be bound already.
2020-08-05 17:17:21 +02:00
055af3a489 Merge branch 'blender-v2.90-release' 2020-08-05 16:56:59 +02:00
adfde60831 Fix T79524: Button alignment broken in some cases
ad4928a171 disabled alignment for too many cases. Still try to avoid
aligning many items, to avoid thousands of redundant alignment
calculations. But now we're much more picky adding an sub-row with
alignment.
2020-08-05 16:56:24 +02:00
2ca006f6c1 Merge branch 'blender-v2.90-release' 2020-08-05 15:59:04 +02:00
87062d4d67 Fix T78412: Ctrl+Spacebar does not maximize Python console on Windows
On windows, spacebar would be passed as UTF-8 text input, despite the
control key being pressed. On macOS, there already was an explicit
exception for this (command key in this case), on Linux XInput already
handled this case for us.
Note that Alt should still allow text input, for special character
sequences.

Issue also happened in the Text Editor if a text data-block was set.
2020-08-05 15:50:58 +02:00
ee351cb74d Fix T78869: denoising performance regression on Windows
Optimization was disabled in this function to work around a bug in MSVC, use
a different solution that does not come with such a big performance regression.
2020-08-05 15:46:44 +02:00
Jeroen Bakker
f7d38e2e64 Fix T77346: GPU Workaround Always Render Using Main Context
In Blender 2.90 EEVEE materials were refactored that introduced crashes on Intel
GPUs on Windows. The crash happened in the `local_context_workaround` that temporary
stored compiled materials in a binary form to reload it in the main GL context.

It has been tested that the workaround isn't needed anymore for HD6xx GPUs, but it
is still needed for HD4000.

After several unsuccesfull fixes we came to the conclusion that we could not support
the local context workaround and needed to come with a different workaround. The idea
of this patch is that in these cases there is only a single context that is used for
rendering. Threads that uses these contextes are guarded by a mutex and will block.

Impact on User Level:
* Due to main mutex lock the UI freezes when rendering or baking or feel less snappy

Reviewed By: Clément Foucault, Brecht van Lommel

Differential Revision: https://developer.blender.org/D8410
2020-08-05 15:45:42 +02:00
43d41675a4 Merge branch 'blender-v2.90-release' 2020-08-05 15:39:08 +02:00
56d7e39b92 Fix T79520: Data Transfer modifier: crash/assert going into editmode on a source object. 2020-08-05 15:36:24 +02:00
40ad989059 BLI: improve dot exporter interface 2020-08-05 15:30:22 +02:00
754a663f68 Cleanup: remove some private fields that are currently unused 2020-08-05 14:59:06 +02:00
c961bf8975 GPUTexture: Fix missing break 2020-08-05 14:17:34 +02:00
42f4233871 Merge branch 'blender-v2.90-release' 2020-08-05 14:10:08 +02:00
229fe01a15 PyDoc: use glClearColor before glClear in gpu docs
ref T79491

Maniphest Tasks: T79491

Differential Revision: https://developer.blender.org/D8471
2020-08-05 14:09:00 +02:00
1cf5c5085e Merge branch 'blender-v2.90-release' into master 2020-08-05 14:04:11 +02:00
f9aba4f6e1 Fix T79374: Render audio produces random clipping
Port of the bugfix from audaspace upstream.
2020-08-05 14:02:59 +02:00
396abbbfe7 Audaspace: port documentation bugfix from upstream. 2020-08-05 14:02:59 +02:00
a6b0a2356a Merge branch 'blender-v2.90-release' 2020-08-05 13:06:11 +02:00
f96afde3bd Fix T79544: No sound in video sequencer preview.
Directly caused by rB2bb73787791a, but actual issue was a pre-exiting
typo that never caused problems so far apparently...
2020-08-05 13:05:51 +02:00
2c5c39d53c Merge branch 'blender-v2.90-release' 2020-08-05 13:00:15 +02:00
02ccc37144 Correct recent fix for Cycles motion blur test
Need to only compare directory name, not the whole path.
2020-08-05 12:59:28 +02:00
85e11ca7fb Fix possible fall-through after recent change 2020-08-05 12:25:12 +02:00
e4a4dc5309 BLI: add dot::Edge.set_label method
This method sets the label of an edge in a dot graph.
2020-08-05 12:22:45 +02:00
fc9f7e3e51 Merge branch 'blender-v2.90-release' 2020-08-05 12:19:28 +02:00
c3113724ed Fix T78630: Custom icons not grayed out in inactive layouts
For regular icons this worked because they used the text color, which
was already grayed out by the caller.
2020-08-05 12:19:14 +02:00
ec9ab00fcb Fix failing USD test on macOS after becoming part of blender test runner 2020-08-05 12:15:17 +02:00
de53178b26 Fix T78777: Cycles motion blur test differences between AVX/AVX2
This appears to be slight precision differences in the Embree implementation,
simply increase the diff threshold a little for these motion blur tests.
2020-08-05 11:45:31 +02:00
7088422283 Merge branch 'blender-v2.90-release' into master 2020-08-05 16:48:28 +10:00
3562978c35 Merge branch 'blender-v2.90-release' into master 2020-08-05 16:48:25 +10:00
79cb0105cd Merge branch 'blender-v2.90-release' into master 2020-08-05 16:48:23 +10:00
8e5a4e3645 Merge branch 'blender-v2.90-release' into master 2020-08-05 16:48:20 +10:00
db907ea888 Merge branch 'blender-v2.90-release' into master 2020-08-05 16:48:17 +10:00
baf015be31 Merge branch 'blender-v2.90-release' into master 2020-08-05 16:48:14 +10:00
05fbbfec0b Merge branch 'blender-v2.90-release' into master 2020-08-05 16:48:03 +10:00
4a289081a5 Keymap: add back Shift-K to cut-through selected faces
Resolves T78540
2020-08-05 16:24:26 +10:00
ef7b804e26 Cleanup: missing 'initialize' -> 'init' from previous cleanup 2020-08-05 11:56:14 +10:00
006698167b Cleanup: spelling 2020-08-05 11:49:31 +10:00
7198e9d10e Fix unreported crash in gpu_free_unused_buffers
As far as I can see, this problem was introduced with the gpu_free_unused_buffers() changes in rB97b597c.

The code checks the returned pointer to stop looping, but the last iteration will return the last GPUTexture and set the queue to NULL, meaning that the next pop() will crash.

Differential Revision: https://developer.blender.org/D8468
2020-08-05 02:35:23 +02:00
fce71a255c EEVEE: LightCache: Add warning if the cache cannot be saved 2020-08-05 02:26:44 +02:00
6390b530d0 Fix T78529: Blend file corrupted during save caused by high Cubemap Size
This just avoid the corruption. A better fix still need to be finished.

See P1564
2020-08-05 02:26:44 +02:00
6be8b6af40 EEVEE: LightCache: Prevent crash when using a lightcache too big
Some implementation have different maximum texture size.
This patch avoid crash when texture allocation fails when:
- trying to bake a lightcache too big for the OpenGL imeplementaion.
- loading a cache from file that is too big for the OpenGL imeplementation.
2020-08-05 02:26:44 +02:00
d1b3da697d GPUTexture: Check PROXY textures for cubemap types
It can happen than some textures are not supported on some implementation
even if they fix the `GPU_max_texture_size` and `GPU_max_texture_layers`.
2020-08-05 02:26:44 +02:00
de947c5c50 GPUTexture: Improve debug print 2020-08-05 02:26:44 +02:00
3a522f7a7f Fix T79213 EEVEE: rendering with motion blur can change current frame
It seems to be expected that the render engine reset to the right CFRA
if it modifies it.
2020-08-05 02:26:44 +02:00
1ccb997c6d Fix T79497: Crash when removing strips with prefetching
This was already fixed by 0471349c90 but accidentally removed in refactor.
2020-08-05 01:40:02 +02:00
deb76548c1 Merge branch 'blender-v2.90-release' 2020-08-04 23:34:55 +02:00
3ebe97c06b Fix T78665: Face Set visibility reverted when chaning Multires Levels
Face Sets where only set and updated on the PBVH after starting a sculpt
tool. In order to preserve the visibility they store when changing
levels, they need to be updated and sync also on PBVH creation

Reviewed By: sergey

Maniphest Tasks: T78665

Differential Revision: https://developer.blender.org/D8225
2020-08-04 23:33:51 +02:00
50e6d56e4e Fix missing duplicates in the subdiv_ccg neighbors function
Duplicates of a grid corner adjacent to an edge which are on the
adjacent grid of the same face were not added when requested.

Needed for D8356 to work, it may also fix some other bug in Multires.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D8385
2020-08-04 23:21:12 +02:00
bf65820782 Sculpt: Cloth brush Pin Simulation Boundary property
The cloth brush has a defined simulated area with a falloff. In the falloff
area (the area between the dashed white circle and the exterior white
circle), simulation properties change in order to fade out the
simulation deformation effects towards the boundary.
With some brushes and stroke types (like anchored strokes with pinching
or grabbing with full strength), it is possible to apply more force than
what the boundary falloff can compensate, so the simulation breaks when
this happens.
This option pins the falloff area with softbody constraints, This
produces a much better deformation falloff and it is no longer possible
to move the vertices near the simulation boundary, so the simulation
won't break no matter the strength of the forces applied inside the
simulated areas.
This is an option as it is particularly useful for some brushes to add
localized details, but for brushes that are supposed to deform the
entire mesh (like the grab brush in D8424), this can add unwanted
softbody constraints that affect the simulation result.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D8435
2020-08-04 23:06:14 +02:00
6faa765af8 Sculpt: Split Box Mask into its own operator
Box mask is not a selection, so it should not be part of the select
operator. This allows to add more sculpt mode specific functionality and
properties and to share more code with the lasso mask operator in a
later refactor.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D8456
2020-08-04 22:52:20 +02:00
1ae9960a15 Merge branch 'blender-v2.90-release' into master 2020-08-04 12:15:14 -06:00
304767dcd3 Fix T78688: Crash changing workspace with specific fullscreen setup
When switching workspaces we need to have an unused screen layout that
we can activate. The other window now showed the only available screen
layout in fullscreen though.
Usually when there's no unused screen layout we duplicate an existing
one, but that code didn't respect the fullscreen case properly.

This also tries to clean up the logic a bit, but things are still rather
complicated to follow.

Changes in this code are always risky. Of course things worked fine in
my tests, but I wouldn't be surprised if something breaks.
2020-08-04 20:12:07 +02:00
97be726f93 Fix T74796: Outliner child objects hidden when collections are filtered
Filtering Collections when also filtering object children would only
display the parent object. Add a check for the NO_CHILDREN filter before
creating the object-parent hierarchy.
2020-08-04 12:05:05 -06:00
e4370eccdf Fix T71488: Flipping Custom Split Normal Data leads to artifacts
The winding order of the faces changes when flipping the faces.
This lead to the loop indices changing as well.

Now we take this into account when restoring and flipping the custom
normals. Before the normals would be swapped.
2020-08-04 19:43:34 +02:00
0d3b5a5068 Fix T71488: Flipping Custom Split Normal Data leads to artifacts
The winding order of the faces changes when flipping the faces.
This lead to the loop indices changing as well.

Now we take this into account when restoring and flipping the custom
normals. Before the normals would be swapped.
2020-08-04 19:32:24 +02:00
205cf0500d Fluid: Minor cleanup in addition to fix for TT72192
Make curly brackets consistent.
2020-08-04 18:20:49 +02:00
df28a68e70 Fix T72192: Mantaflow does not render flame when flow source is hidden from Renders
The problem in this case was that the flag for active fire was not set. With hidden flow sources the flag was not updated in update_flowsflags().

The solution for this is to take the active field from the config cache file.
2020-08-04 18:09:17 +02:00
f2ac432467 Cleanup: Bevel: Split two case for loop into separate function
Previously a for loop with two iterations was used to calculate the
3D segment locations for the input number and the higher power of 2.
Splitting off the inside of the for loop to a separate function makes
the code more readable.

This commit also includes a simple timer for bevel, enabled with a
define. Interestingly, the cleanup in this commit happended to give
a 3% speedup on a Ryzen 3700x for a bevel calculation with 64
segments.
2020-08-04 11:43:42 -04:00
e818f1274b Fix T78932: fix linking reroute nodes of different type
Reviewers: mano-wii

Differential Revision: https://developer.blender.org/D8460
2020-08-04 17:36:50 +02:00
93d8373edb Merge branch 'blender-v2.90-release' 2020-08-04 17:14:06 +02:00
a4a814a180 Fix buildbot macOS packaging error after recent changes 2020-08-04 17:13:09 +02:00
f130cd1169 Point Clouds: basic support for instancing objects on points
Same exact system as instancing on vertices for a mesh. More powerful ways
of instancing will be added at some later point, but this makes the basics
works and is consistent with other geometry types.
2020-08-04 17:11:00 +02:00
89baafc8e2 Merge branch 'blender-v2.90-release' 2020-08-04 16:57:50 +02:00
9538e38704 Fix buildbot packaging error after recent changes 2020-08-04 16:54:18 +02:00
21c31885ed Merge branch 'blender-v2.90-release' 2020-08-04 16:39:03 +02:00
b1976d131c Fix broken Alembic tests following motion blur commit
The tests were broken because of an extra call to
RNA_def_struct_name_property which set the name of the velocity
attribute to be the string used to identify CacheFiles in
bpy.data.cachefiles.
2020-08-04 16:10:51 +02:00
7bad5e0d18 Cleanup: clang-format after recent cleanup commit
Remember to run `make format` after any massive cleanup please.

This "issue" introduced on 901ee66ea1.
2020-08-04 16:01:26 +02:00
16c7b6a7fe Buildbot: make code signing of packages optional with --codesign parameter
This is in preparation of doing builds per commit that will not be code signed.

Ref D8438

Differential Revision: https://developer.blender.org/D8451
2020-08-04 15:44:41 +02:00
0e87a35f8e Merge remote-tracking branch 'origin/blender-v2.90-release' 2020-08-04 15:37:49 +02:00
e8483f9bd7 Fix T78758 Alembic export: crash when file is in use by another application
In cases when the output file cannot be opened, an exception is thrown that
was not caught.
2020-08-04 15:23:43 +02:00
f5919a7ad1 Merge branch 'blender-v2.90-release' 2020-08-04 15:05:39 +02:00
e1a10b5e53 Fix T79234: Material preview does not update
When changing the material while the properties editor temporarily isn't
visible (e.g. because another editor is in full-screen or a different
workspace is active), the preview wouldn't be updated on changes.

Always trigger a material preview update on screen layout or editor type
changes.
2020-08-04 15:05:24 +02:00
5270462953 Fix T79234: Material preview does not update
When changing the material while the properties editor temporarily isn't
visible (e.g. because another editor is in full-screen or a different
workspace is active), the preview wouldn't be updated on changes.

Always trigger a material preview update on screen layout or editor type
changes.
2020-08-04 14:55:55 +02:00
675fa2ee13 Refactor: rename SpaceType->new to SpaceType->create
The data member `new` was conflicting with the `new` keyword
when `BKE_screen.h` was included in C++ files.

Reviewers: sergey

Differential Revision: https://developer.blender.org/D8459
2020-08-04 14:40:15 +02:00
7fbbe71922 Depsgraph: Fix wrong forward declarations 2020-08-04 14:25:13 +02:00
5f621a12c6 Merge branch 'blender-v2.90-release'
Conflicts:
	source/blender/editors/gpencil/gpencil_primitive.c
2020-08-04 13:36:58 +02:00
ca606bf551 Merge branch 'blender-v2.90-release' into master 2020-08-04 21:28:21 +10:00
701a9d3917 Cleanup: typos & co in UI messages (and some other places). 2020-08-04 13:26:58 +02:00
0dff6b2b4b Cleanup: unused main argument 2020-08-04 21:25:28 +10:00
164f40c50a Fix T79503: Selecting edit-bones while holding Ctrl crashes 2020-08-04 21:23:53 +10:00
d6762bedee Merge branch 'blender-v2.90-release' 2020-08-04 12:59:20 +02:00
f921ae4665 Fix T79453: Motion Tracking: marker does not remember 'enabled' state
Caused by rB63ee3db96107.

While above commit corrected the clip offset, it also removed logic to
ensure a marker on a particular frame. This is needed though, otherwise
changes on a particular frame are applied to the marker being returned
by 'BKE_tracking_marker_get' which can be a completely different marker
if none exist for that frame yet.

This patch partly reverts rB63ee3db96107 and reintroduces the framenr
for the MarkerUpdateCb and uses that to ensure a marker on that frame.

Candidate for backporting to 2.83 LTS?

Reviewers: sergey, jacqueslucke

Subscribers:
2020-08-04 12:52:40 +02:00
a9e0aeaf65 Fix crash switching render slots when there is only one slot 2020-08-04 20:11:57 +10:00
778f0aca52 Merge branch 'blender-v2.90-release' 2020-08-04 12:08:09 +02:00
03c2439d96 Fluid: Do not show fluid if frame is out of cache range
Before: If the current frame is out of the cache start/end range, the viewport will show the fluid as it was on the last frame that was still in the cache frame range.

Now: If the current frame is out of the cache start/end range, the viewport will show no fluid at all (even if there are cache files present for this frame).

This fix is related / in response to T79423.
2020-08-04 11:45:05 +02:00
8d3b8bc835 Depsgraph: Use UUID to identify pose channels
Fixes possible fiasco caused by re-allocation re-using pointers between
pose channels.

Differential Revision: https://developer.blender.org/D8453
2020-08-04 11:40:09 +02:00
52c2f296bc Pose channel: Add session UUID
Allows to identify pose channels more reliably than by the pointer.
2020-08-04 11:40:09 +02:00
51af20b856 Cycles: Fix nan in decomposed transform for degenerated input
The decomposed transform would have consists of nan values if the input
transform had zero scale.

Now the decomposition will check for zero scale, and if it is detected
then the result will be ensured to be finite. Additionally, rotation
value will be copied from previous/next time step to help avoiding
obscure interpolation.

The latter step can become more comprehensive than the current simple
implementation.

Differential Revision: https://developer.blender.org/D8450
2020-08-04 11:40:09 +02:00
7f6530e5bd Cycles: Add finite checks for float4 and transforms
Currently unused, preparing for an upcoming development.
2020-08-04 11:40:09 +02:00
b38c04aebe Cleanup: fixed unused parameter warning
No functional changes.
2020-08-04 11:36:28 +02:00
3642cbb1d2 Cleanup: converted Depsgraph Building Pipeline to object-oriented code
This will make it easier & cleaner to make custom-built depsgraph (for
example for exporting invisible objects to USD or Alembic, see T75936).

No functional changes.

Reviewed by: sergey

Differential Revision: https://developer.blender.org/D8423
2020-08-04 11:36:24 +02:00
15ad4f6f1f Merge branch 'blender-v2.90-release' 2020-08-04 11:57:09 +03:00
9306037ed3 Node Groups: expose the SOCK_HIDE_VALUE flag for node group inputs.
This flag specifies that even when the socket is not connected,
the node should not display the input field for the constant input
value. This is useful for inputs like Normal, which have special
handling for the missing input case and don't use a constant value.
Currently there is no way to change this flag from Python, and
through UI it can only be done by re-creating the socket.

This patch exposes the flag through RNA and UI, makes sure it
is properly updated when changed, and adds special handling to
ensure that it is correctly set when creating a node group from
a node set that includes reroute nodes.

Differential Revision: https://developer.blender.org/D8395
2020-08-04 11:29:16 +03:00
b016e7f258 Node Groups: fix placement of the Output node when creating a group.
Instead of assuming the node width, compute the actual right bound.
Otherwise BSDF nodes tend to be too wide, and intersect Output.

Differential Revision: https://developer.blender.org/D8395
2020-08-04 11:29:01 +03:00
f5eae90277 Fix T79493: EEVEE LightProbe Display
Introduced by recent EEVEE GLSL refactoring {da741013a1e1}
2020-08-04 10:09:31 +02:00
105ed22b95 Merge branch 'blender-v2.90-release' into master 2020-08-04 15:35:03 +10:00
c1386795a9 Modifier: bypass mesh conversion for hooks in edit-mode
Avoid the conversion for the hook modifier as riggers
may need to enable this modifier in edit-mode.

The speedup of the modifier alone is significant since the hook
operation is simple compared to conversion that took over 99.9%
of the time in my tests, however the overall speedup was around to 1.6x.
2020-08-04 15:34:04 +10:00
6791b88d28 Merge branch 'blender-v2.90-release' 2020-08-03 18:28:59 -04:00
9de5adc6a1 Fix: Remove debug print added mistakenly
This print whenever units are evaluated in number input was added in
45dbc38a8b mistakenly.
2020-08-03 18:28:39 -04:00
4b99df20d5 Merge branch 'blender-v2.90-release' 2020-08-03 18:18:02 -04:00
fbc3c1b24d Fix (unreported): Bevel tool custom profile uses wrong segments number
The bevel code initialized the CurveProfile with the "higher power of 2"
segments after the normal number of segments, leaving the widget in an
incorrect state after the calculation. A simple fix is to re-order the
initializations, doing the input number second.
2020-08-03 18:12:24 -04:00
862d79fffc Cleanup: Reduce indentation in function 2020-08-03 17:40:07 -04:00
452b896f2d Ocean Modifier: Fix render resolution only used for baking
The modifier needs to check that the cached ocean has the correct
resolution.
2020-08-03 15:33:32 -04:00
b5c737469d Cleanup: Avoid double operator name lookup 2020-08-03 14:00:14 -04:00
Adrian Newton
8356012068 UI: Change Header Position Label 'Default' to 'Keep Existing'
'Default' actually means 'Keep Existing' and it makes more sense to
display the more descriptive label.

Differential Revision: https://developer.blender.org/D7614
2020-08-03 12:37:48 -04:00
10590b0500 Fix missing shortcut indicators and crash on shortcut change
Fixes T78346.

The shortcut display and change code is context sensitive. To make it
work correctly the context needs to be set properly.
When executing operators from the dropdowns, the active region is the
header, but the shortcut handlers are set for the main region. So make
sure that is used instead.

This also sets the main region active for context menu operators, where
this issue shouldn't be present. Doing it anyway shouldn't hurt though
and fixes this issue in case somebody displays the context menu in the
header as dropdown too.
2020-08-03 18:26:06 +02:00
e9bcf09819 Cleanup: Typos in comments. 2020-08-03 17:42:45 +02:00
3593dff147 Fix T79374: Render audio produces random clipping
Port of the bugfix from audaspace upstream.
2020-08-03 17:42:36 +02:00
d66009f179 Fluid: Adjustments to force component reset
Instead of clearing forces at the end of the simulation step, they will now be cleared before writing to them, i.e. at the beginning of a step.

Also cleaned up minor areas that I looked at while making this change.
2020-08-03 17:39:56 +02:00
f24920790d Merge branch 'blender-v2.90-release' 2020-08-03 16:24:34 +02:00
473d9507fa Fix T78536: Crash calling object.modifier_apply on an empty
Caused by rB6add0cc88a0d.

Maniphest Tasks: T78536

Differential Revision: https://developer.blender.org/D8440
2020-08-03 16:20:46 +02:00
Phil Stopford
a44299ccd1 Ocean Modifier: Add viewport resolution
Following work done in 2.83, the resolution control is now a real
level-of-detail parameter. It is now useful to be able to set the
resolution for display independently from render. This is true for
both mesh generation and mesh deformation modes.

For compatibility with old scenes, resolution is retained and is the
render resolution. Old modifiers loaded have the value of resolution
also applied to viewport resolution. This allows newer modifiers to
be used in older versions without trouble

Differential Revision: https://developer.blender.org/D8336
2020-08-03 10:08:31 -04:00
30b52b6a4a Merge branch 'blender-v2.90-release' 2020-08-03 15:15:54 +02:00
2bb7378779 Fix T79222: Assert due to multiple building of same scene sequencer in depsgraph.
Just check and skip building if it has already been done before.

Thanks to @sergey for the help.
2020-08-03 15:11:05 +02:00
92f6f6d30e Audaspace: port documentation bugfix from upstream. 2020-08-03 14:21:54 +02:00
61eec61adb Merge branch 'blender-v2.90-release' into master 2020-08-03 21:14:49 +10:00
3f94f47113 Fix T79482: Triangulate quads with 'Beauty' can make zero area faces 2020-08-03 21:12:46 +10:00
1c4a695d70 Merge branch 'blender-v2.90-release' 2020-08-03 13:01:21 +02:00
14b77b37cb Fix T78428: Checkbox labels don't highlight on mouse-over in popovers
The text colors set by the general widget state function
(`widget_state()`) would always be overriden by the menu-back text
colors to avoid contrast issues. This would only respect the selected
state, not other states.

Address this now by changing the input theme colors to use the menu-back
ones, rather than overriding after the fact (calling `widget_state()`).
2020-08-03 13:00:53 +02:00
3c9cb62d82 Merge branch 'blender-v2.90-release' 2020-08-03 12:40:06 +02:00
33e6562a8a Fix T78266: Mantaflow: changing flow type (fire -> fire + smoke) resets Surface Emission
Changing the surface distance through the flow type is inappropriate here. It had been added to ensure that liquids / smoke use a different emission value.

Now the value will only be changed when changing from a gas to a liquid emitter or, vice-versa, when changing from a liquid to a gas emitter.
2020-08-03 12:38:07 +02:00
db5915d863 Merge branch 'blender-v2.90-release' 2020-08-03 12:36:52 +02:00
nutti
b5e3451540 Fix parameters in bpy.props.StringProperty Python API docs
There is a parameter typo in Python API document about bpy.props.StringProperty.
This patch fixes this.

Also this patch should apply to 2.90 branch as well.

Reviewed By: Grische, mont29

Differential Revision: https://developer.blender.org/D8430
2020-08-03 12:35:54 +02:00
633e9cef8c Merge branch 'blender-v2.90-release' 2020-08-03 12:11:52 +02:00
057f3f2f3d Fix T78575: Assert when using UILayout.prop_tabs_enum
Code required the tabs to be placed in an aligned region. Code should
work fine even for unaligned regions though, so I don't see a reason to
forbid this.
2020-08-03 11:57:20 +02:00
e17befe368 Install_deps: add libgmp as default dependency.
This is a common system library, no need for fancy building this time...

Part of D8384.
2020-08-03 10:44:07 +02:00
977f89ef2d Merge branch 'blender-v2.90-release' 2020-08-03 10:30:59 +02:00
fe70605a2a Building: Add ceres to Ninja's heavy jobs pool.
Some files in this library require more than 1.5Gb to build, so they
also belong to the 'heavy' pool.
2020-08-03 10:30:33 +02:00
040d7872e8 Merge branch 'blender-v2.90-release' into master 2020-08-03 18:03:49 +10:00
8f22feefbc Fix T79440: Deform modifiers fail in edit-mode when not first
Lattice, armature & curve only worked when an edit-mesh was passed in,
the mesh argument was being ignored.

Regression in 9f5833798c
2020-08-03 18:01:34 +10:00
144f780c71 Cleanup: remove unused code, update comments 2020-08-03 15:14:08 +10:00
83d6290800 Cleanup: remove trailing space, newlines at eof 2020-08-03 15:14:02 +10:00
21f150cc90 Merge branch 'blender-v2.90-release' into master 2020-08-03 15:13:52 +10:00
d406edf1ee Mesh: correct negative material indices when validating
Fixes corrupt mesh from T79451.
2020-08-03 14:48:16 +10:00
b5dcf74636 Cycles: add support for rendering deformation motion blur from Alembic caches.
This patch adds the ability to render motion blur from Alembic caches.
The motion blur data is derived from a velocity attribute whose name has
to be defined by the user through the MeshSequenceCache modifier, with a
default value of ".velocities", which is the standard name in Alembic
for the velocity property, although other software may ignore it and
write velocity with their own naming convention (e.g. "v" in Houdini).

Furthermore, a property was added to define how the velocity vectors
are interpreted with regard to time : frame or second. "Frame"
means that the velocity is already scaled by the time step and we do not
need to modify it for it to look proper. "Second" means that the unit
the velocity was measured in is in seconds and so has to be scaled by
some time step computed here as being the time between two frames (1 /
FPS, which would be typical for a simulation). This appears to be
common, and is the default behavior.

Another property was added to control the scale of the velocity to
further modify the look of the motion blur.

Reviewed By: brecht, sybren

Differential Revision: https://developer.blender.org/D2388
2020-08-03 03:44:40 +02:00
396d0b5cd0 Particles: new Age Reached Event, Kill Particle and Random Float node
The hardcoded age limit is now gone. The behavior can be implemented
with an Age Reached Event and Kill Particle node. Other utility nodes
to handle age limits of particles can be added later. Adding an
Age Limit attribute to particles on birth will be useful for some effects,
e.g. when you want to control the color or size of a particle over its
life time.

The Random Float node takes a seed currently. Different nodes will
produce different values even with the same seed. However, the same
node will generate the same random number for the same seed every
time. The "Hash" of a particle can be used as seed. Later, we'd want
to have more modes in the node to make it more user friendly.
Modes could be: Per Particle, Per Time, Per Particle Per Time,
Per Node Instance, ...
Also a Random Vector node will be useful, as it currently has to be
build using three Random Float nodes.
2020-08-02 22:10:47 +02:00
d1063575b5 Merge branch 'blender-v2.90-release' 2020-08-02 21:00:09 +02:00
0264f53e30 Fix T67181: Only the first added movie strip will have audio below
Find free slot first for sound strips then for movie strips.
This patch also fixes issue where all strips were added to channel 2 by default.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D8339
2020-08-02 20:54:37 +02:00
189eb2550d Fix T66805: No cache invalidation with remove gaps operator
Reviewed By: brecht

Differential Revision: https://developer.blender.org/D8379
2020-08-02 20:53:55 +02:00
4f27e94146 Merge branch 'blender-v2.90-release' into master 2020-08-02 18:13:15 +10:00
422954b708 Merge branch 'blender-v2.90-release' into master 2020-08-02 18:13:11 +10:00
ed6bec8d1a Merge branch 'blender-v2.90-release' into master 2020-08-02 18:13:05 +10:00
89167dd304 Merge branch 'blender-v2.90-release' into master 2020-08-02 18:12:58 +10:00
nutti
cc0d8ab036 Docs: add translation keyword argument default for msgctxt 2020-08-02 18:12:31 +10:00
nutti
c442ff0017 Fix RST syntax for freestyle documentation 2020-08-02 18:12:22 +10:00
f349a53c08 Fix T78691: Fly/Walk navigation ignores object channel locks 2020-08-02 18:10:07 +10:00
70d7805fa9 Cleanup: pass const matrices
Also order return matrices last.
2020-08-02 18:02:20 +10:00
a3a6b71a9d Cleanup: pass const matrices
Also order return matrices last.
2020-08-02 17:17:31 +10:00
0e308b07a0 Merge branch 'blender-v2.90-release' into master 2020-08-02 16:20:51 +10:00
ba6ed01058 Fix UV face dot refresh when toggling sync-select 2020-08-02 16:11:07 +10:00
8305dd9499 Cleanup: localize creator.c definitions
As creator.c is used for the 'main' function,
avoid obscure declarations being placed so prominently.

- Move Blender as a Python module declarations into it's own section.
- Move USD declaration to an 'extern' just before it's called.
2020-08-02 13:11:30 +10:00
6a444830a3 GPU: Convert gpu_matrix.c to C++ 2020-08-02 02:10:22 +02:00
6941e27f4a GPU: Convert gpu_shader_interface.c to C++ 2020-08-02 02:10:22 +02:00
de097b28cc Cleanup: OCIO: Remove extern "C" around blender headers 2020-08-02 02:10:22 +02:00
7cd2c1fd2e Particles: support custom particle events in solver
Previously, there were only particle-birth and time-step events.
Now the solver can handle custom events. On the user level
this does not change anything yet. This feature of the solver
will be used by an upcoming Age Reached Event node and
possibly others. When this node exists, I can finally remove
the hardcoded maximum particle age.
2020-08-01 21:56:05 +02:00
6141549fee Fix error in recent rename
This function is defined outside of Blender.
2020-08-01 20:04:22 +10:00
6119f3cad1 Cleanup: spelling (initialized) 2020-08-01 13:57:27 +10:00
901ee66ea1 Cleanup: use term init instead of initialize/initialise
The abbreviation 'init' is brief, unambiguous and already used
in thousands of places, also initialize is often accidentally
written with British spelling.
2020-08-01 13:51:05 +10:00
006e850a84 Cleanup: spelling 2020-08-01 12:52:11 +10:00
03afffc96a Merge branch 'blender-v2.90-release' into master 2020-08-01 12:18:29 +10:00
06f3312b04 Merge branch 'blender-v2.90-release' into master 2020-08-01 12:18:24 +10:00
72b422c1e1 UV: support select linked with sync-select in vert/edge modes 2020-08-01 12:15:05 +10:00
732434cb1f Fix T46568: UV select-linked failure to de-select
Shift-L was de-selecting all instead of the linked UV's.
2020-08-01 12:14:42 +10:00
106e7654e8 Fluid: Another adjustment for Python pointers
Yet another update to ensure that pointer variables are always up to date, i.e. those referencing the memory allocated by Mantaflow. Outdated pointers usually show up through flickering in viewport.
2020-07-31 23:27:51 +02:00
251ae108e7 Merge branch 'blender-v2.90-release' 2020-07-31 18:20:51 +02:00
71683be4bb Fix T78884: GPencil weight paint crash when painting over modifier generated points
The weight must be added only to the real points, not to the autogenerated points by modifiers. This affects, not only to subdivide, but to any modifier that generate points.
2020-07-31 18:20:39 +02:00
7e64f6cee4 Fluid: Fix for Python pointer update (flickering in smoke/fire issue)
In f2b04302cd the pointer update was refactored. It was sufficient to update pointers just in replay mode at the end of a step since the 'ensure()' functions from manta_fluid_API.cpp had their own pointer update call. These were removed in 51f4bee5a5, however, and so in order to still have some sort of update, the given update call needs to be available to all cache types.
2020-07-31 17:42:08 +02:00
83f8223543 Deps builder: Add support for building GMP
Required for the new boolean code, disabled by default
until all platforms have landed the libs and the boolean
code actually lands in master.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D8384
2020-07-31 09:34:26 -06:00
a2c6c51647 Merge branch 'blender-v2.90-release' 2020-07-31 16:46:35 +02:00
cab9673bed Fix T79111: Cycles: Image Sequence not rendering
Caused by c7aa0f9d74.

Since above commit, BKE_image_user_frame_calc requires an image (not
just the iuser) to get the framenumber.

Cycles used to call this with NULL image (in `image_user_file_path` and
`image_user_frame_number`), now pass the image as well.

Maniphest Tasks: T79111

Differential Revision: https://developer.blender.org/D8439
2020-07-31 16:39:22 +02:00
2a0a2c1054 Fluid: Cleanup and improved readability
A collection of multiple changes that had been living in my stash:

- Use nullptr instead of NULL in C++ files
- Removed unused/deprecated functions from headers
- Cleared animatable flag in cache UI
- Comment cleanups
2020-07-31 16:32:02 +02:00
51f4bee5a5 Fluid: Refactored Python fluid initialization functions
Initialization functions now have a return type which will be asserted during fluid object creation.
2020-07-31 16:32:02 +02:00
f2b04302cd Fluid: Refactored Python pointer update function
Use static_cast() where possible and refresh pointers for every frame when in replay mode. The latter is particularly important as this seems to have caused the issue where smoke in the viewport was flickering when loading data from pointers after loading them from disk for the frame before (e.g. when resuming a bake job).
2020-07-31 16:32:02 +02:00
227e20f370 Merge branch 'blender-v2.90-release' 2020-07-31 11:25:56 -03:00
1ff1a2be9c Fix T78600: Crash when transforming doubles with mirroring on
`EDBM_verts_mirror_cache_begin_ex` could do a better work avoiding these
duplicates, but this is a separate problem.
2020-07-31 11:24:34 -03:00
201b4051ba Fluid: Fix missing WITH_FLUID in draw code
The new draw code from 486c7b87fb  was just missing a WITH_FLUID flag.
2020-07-31 15:19:29 +02:00
81caec8c60 Fix blender_test runner build on the buildbot on Linux and macOS
Add our own copy of the gtest discovery scripts from CMake a few reasons:
* Use the very latest version which supports PRE_TEST for Windows
* Fix usage of [] symbols in file paths that fail with the zsh shell
* Disable asan leak checker when discovering tests

This means Windows also no longer requires the very latest CMake 3.18.
2020-07-31 14:41:13 +02:00
5628aaeee1 Fix build of blender_test runner on macOS 2020-07-31 14:15:42 +02:00
3785dc59d1 Merge branch 'blender-v2.90-release' 2020-07-31 13:47:46 +02:00
feaed44ef6 GPencil: Fix unreported missing last point in NURBS conversion
The last point of the curve was missing.
2020-07-31 13:47:12 +02:00
c565f16afb Fix T79397: blurry icons at some UI scales, after recent refactor
Solution found by Yevgeny Makarov.
2020-07-31 12:39:58 +02:00
ded4b72002 Merge branch 'blender-v2.90-release' 2020-07-31 12:20:27 +02:00
627b294317 Fix build error with clang 2020-07-31 12:03:11 +02:00
db24e289b2 Merge branch 'blender-v2.90-release' 2020-07-31 11:53:22 +02:00
de68880e79 Cleanup: Remove unused original pointer in Sequence 2020-07-31 11:45:40 +02:00
1e7afea2bb Fix T78835: Ghosting audio after using undo
The root of the issue comes to the fact that sub-data pointers were
used to match strips before/after copy-on-write. The undo system might
re-use sub-data pointers after re-allocating them, making it so that,
for example, pointer used by sound strip is later re-used by video
strip.

This fix takes an advantage of recently introduced per-sequence UUID
and uses it to match sequences before/after copy-on-write.
2020-07-31 11:45:40 +02:00
9ea6228b07 Sequencer: Ensure UUIDs are updated when needed
Document cases where it seems that they need to be updated, but where
the proper behavior is to not update the UUID.
2020-07-31 11:45:40 +02:00
eb8cbb6d7c Depsgraph: Add command line argument to debug UUIDs
Will trigger code paths which makes sure UUIDs are generated and
are unique.

Enabled with --debug-depsgraph-uuid (which is also implied by
--debug-depsgraph).
2020-07-31 11:45:00 +02:00
cc63897c22 Sequencer: Add session UUID check function
Is aimed for use during development and debug, to help
verifying that operations do not leave sequences with
invalid UUIDs.
2020-07-31 11:44:59 +02:00
3305a94fa1 Sequencer: Add session UUID management to Sequence
This is the first step for having sequences covered with session UUID
with the goal to remove code which uses original sequence pointer to
match sequences.

Currently this UUID is maintained on file load, allocation and leaf
duplication function.There are more cases to cover and ensure UUID
is re-generated or re-used when needed. It will be done as follow-up
development.
2020-07-31 11:44:59 +02:00
44b32e0e4a Sequencer: Add session UUID field to the Sequence DNA 2020-07-31 11:29:55 +02:00
de21ddf821 BLI: Initial implementation of generic session UUID API
Covers basics like generation of new UUID.

Also contains code needed to use the SessionUUID as a key in the Map.
2020-07-31 11:24:03 +02:00
cd579c4996 Add generic session UUID structures to DNA
Allows to use pre-defined structure for session UUIDs in all data
structures which needs it: pose channels, sequencer strips, modifiers.

The goal of all this is to have a reliable way of matching original
and copy-on-written versions of data, so that it's possible to
preserve runtime caches.
2020-07-31 11:22:05 +02:00
f379bb368b BLI: fix float3 in-place operators 2020-07-31 11:17:33 +02:00
585c9c2f23 Merge branch 'blender-v2.90-release' 2020-07-31 10:51:00 +02:00
298d5eb669 UI: fix buttons ranges not properly updated when tabbing to next/previous
button

This was reported for the FCurve modifier restrict ranges, but might fail
elsewhere, too. Reason is that the post_but has its range (hardmin/
hardmax etc) set before the updates to the active button take place, so
changes here dont end up on the post_but (even though the RNA range
function is properly called for a new defined button - new one is not the
same as the post_but though).

Now update the ranges on the post_but when that gets active.

Fixes T78763

Maniphest Tasks: T78763

Differential Revision: https://developer.blender.org/D8265
2020-07-31 10:47:52 +02:00
f3e8326453 Cleanup: fix function signature 2020-07-31 10:13:33 +02:00
59c14c1a62 Merge branch 'blender-v2.90-release' 2020-07-30 22:08:54 -04:00
8c375113b5 UI: Label Fixes
These were added in rB146473f08335e8cb774ccaf1baad82a1d308fbe1 however 
there were a few errors with the labels:

1. Underscore in label
2. Abbreviation when not needed
2020-07-30 22:05:25 -04:00
44928a2a8f Fix: Blender_test not working on windows.
This bumps the minimum requirement for cmake from 3.10 to 3.18 on windows
if `WITH_GTESTS` is enabled.

Reviewed By: sergey brecht sybren campbellbarton

Differential Revision: https://developer.blender.org/D8405
2020-07-30 13:18:05 -06:00
848cbe889b Fix T79347 GPU: Segfault starting blender 2020-07-30 19:43:53 +02:00
9132fd8825 Merge branch 'blender-v2.90-release' into master 2020-07-30 11:24:39 -06:00
f45f8a7a89 Fix T79278: Selected object filter skipping collection instances
Collection instance datablocks were not filtered out when only showing
the selected object. They were treated as a collection (which should
show when filtering objects). Adds a case to check if the parent is an
object.
2020-07-30 11:19:07 -06:00
David Vogel
820ca419e0 Add compound shape for rigid body simulation
This patch adds a new compound shape entry to the shape selection
dropdown. It also corrects wrong inertia calculation for convex hulls,
that resulted in strange behavior for small objects.

The compound shape take the collision shapes from its object children
and combines them. This makes it possible to create concave shapes from
primitive shapes. Using this instead of the mesh collision shape is
often many times faster.

Reviewed By: Sergey, Sebastian Parborg

Differential Revision: http://developer.blender.org/D5797
2020-07-30 18:53:35 +02:00
d3944940f9 Merge remote-tracking branch 'origin/blender-v2.90-release' 2020-07-30 18:38:08 +02:00
Valentin
4089b07aa0 Cleanup: Remove pre 2.80 headers
Review: D8341
2020-07-30 18:37:36 +02:00
8dc2fbd7b6 Fix T79117: dependency cycle with passive rigid body objects
Reviewers: zeddb

Differential Revision: D8431
2020-07-30 18:22:29 +02:00
27d50d6f67 Enable header auto-complete suggestions in Xcode
Description of `USER_HEADER_SEARCH_PATHS` build setting:
"
This is a list of paths to folders to be searched by the compiler
for included or imported user header files (those headers listed
in quotes) when compiling C, Objective-C, C++, or Objective-C++.
Paths are delimited by whitespace, so any paths with spaces in
them need to be properly quoted. See Always Search User Paths
(Deprecated) (ALWAYS_SEARCH_USER_PATHS) for more details
on how this setting is used. If the compiler doesn't support the
concept of user headers, then the search paths are prepended to
the any existing header search paths defined in Header Search
Paths (HEADER_SEARCH_PATHS).
"

http://help.apple.com/xcode/mac/current/#/itcaec37c2a6

Xcode doesn't use `HEADER_SEARCH_PATHS` for auto-complete. Only the
header files in the same directory as the current file are suggested.

CMake as of now correctly sets `SYSTEM_HEADER_SEARCH_PATHS` and lumps the
rest in `HEADER_SEARCH_PATHS`.  The standard way is to use
`USER_HEADER_SEARCH_PATHS` & `SYSTEM_HEADER_SEARCH_PATHS` and let
`HEADER_SEARCH_PATHS` be used as a fallback for compilers which do not
distinguish between `<*.h>` and `"*.h"` syntax.

So set `USER_HEADER_SEARCH_PATHS` to the include paths specified
in the `CMakeLists.txt` files of all targets.
2020-07-30 21:13:26 +05:30
168653ed1d Merge branch 'blender-v2.90-release' 2020-07-30 17:36:20 +02:00
ff1d599172 Fix T79357: VSE crash on prefetching when performing cuts
Caused by {rBa1a333a1e92e}

`BKE_sequencer_prefetch_get_original_sequence` cant get a sequence in
`BKE_sequencer_cache_put`.

rBa1a333a1e92e moved multiple NULL checks (including the one checking
seq) above BKE_sequencer_prefetch_get_original_sequence (this should
never return NULL really, but this is for another fix).

So solution suggested by @ISS is to just stop prefetching all together
before changing content of seqbase.

Maniphest Tasks: T79357

Differential Revision: https://developer.blender.org/D8421
2020-07-30 17:29:48 +02:00
b1bfcf9f6b GPU: Fix compilation error (missed one) 2020-07-30 17:17:16 +02:00
2d38ff67d3 GPU: Fix compilation error 2020-07-30 17:08:23 +02:00
d7a28b3d1a Cleanup: IMB: Put lowercase prefix on static functions 2020-07-30 16:55:42 +02:00
da741013a1 EEVEE: GLSL refactor/cleanup
- add the use of DRWShaderLibrary to EEVEE's glsl codebase to reduce code
complexity and duplication.
- split bsdf_common_lib.glsl into multiple sub library which are now shared
with other engines.
- the surface shader code is now more organised and have its own files.
- change default world to use a material nodetree and make lookdev shader
more clear.

Reviewed By: jbakker

Differential Revision: https://developer.blender.org/D8306
2020-07-30 16:44:58 +02:00
55401fbb3d IMB: Refactor util_gpu.c to not expose enum getters
This was causing compiler error on MSVC and is not a good idea
in general.
2020-07-30 16:44:57 +02:00
008ccacdfc Cleanup: Use MEM_calloc_arrayN in the Cloth Brush
Reviewed By: sergey

Differential Revision: https://developer.blender.org/D8432
2020-07-30 16:23:19 +02:00
2e33c5ca15 Sculpt: Use constraints in cloth deform brushes
Previously, deform brushes were modifying the final positions in the
simulation directly, which was causing all sorts of artifacts in the
deformed area and problems with other features of the solver.
Now these brushes deform a separate array of positions and the solver
adds constraints to them, so the real vertices are moved when solving
the constraints. This prevents those artifacts and gives the brush a
much better behavior.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D8424
2020-07-30 16:10:15 +02:00
49c1359b55 Sculpt: Enable persistent base for the cloth brush
The cloth brush builds the constraints when the stroke starts usign the
current state of the mesh. This means that deformations profuced by the
simulattion will accumulate after multiple strokes as it will always
start from the previous deformed state. While this is useful in many
cases, for other uses it is convenient to always simulate the same
initial shape, but applying different forces to it.

The persistent base options work like the persistent base in the layer
brush and allows the cloth brush to not accumulate deformation after
each stroke. When enabled, constraints are created for the shape stored
in the persistent base instead of from the current state of the mesh.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D8428
2020-07-30 15:59:35 +02:00
27b643d27a Merge branch 'blender-v2.90-release' 2020-07-30 14:27:07 +02:00
9cac158e96 Fix T78730: CLOG writes/reads outside allocated memory.
Fix several issues in CLOG code:
* In `clg_str_reserve`, allocated memory may be bigger than requested
  one, do not assign the latter back to `cstr->len_alloc`.
* `clg_str_vappendf` was mis-interpreting returned value from
  `vsnprintf`, and completely mixing total allocated memory and extra
  needed amount of memory to allocate...

Simplified code of `clg_str_vappendf` to only have allocating code
handled in one place, makes things easier to follow too.

Think this should also be beckported to 2.83.
2020-07-30 14:26:44 +02:00
19175f4757 GPUBatch & GPUImmediate: Use GPUShader instead of using raw OGL handle 2020-07-30 13:28:50 +02:00
3eff2b44db Merge branch 'blender-v2.90-release' 2020-07-30 13:02:29 +02:00
4251a87bf6 Fix usercount not decrementing in gpencil_stroke_separate_exec
This is part of T79273 where separating a stroke would result in
multiuser gpencil data for the original object.
Real underlying issue seems to be that gpencil multiuser objects (also
the ones created by Alt+D duplicating) have a problem evaluating
modifiers correctly [this will need further investigation].
Not sure if this is a limitation of D5470?

This patch only corrects the usercount on separating [which already fixes
the scenario reported because singleuser gpencil modifiers work
correctly].

Note: we could have also called `ED_object_add_duplicate` with the
`USER_DUP_GPENCIL` dupflag -- that would have taken care of the usercount
--, but then the whole following logic in `gpencil_stroke_separate_exec`
would need to change from **adding** layers/frames/strokes to
**removing** these.

Part of T79273

Maniphest Tasks: T79273

Differential Revision: https://developer.blender.org/D8419
2020-07-30 12:47:54 +02:00
742ad5acbc Merge branch 'blender-v2.90-release' into master 2020-07-30 17:45:26 +10:00
2bc017ece1 Fix T79207: Crash converting curve to mesh 2020-07-30 17:42:09 +10:00
5893a1562f Cleanup: split curve bevel into separate file 2020-07-30 14:54:39 +10:00
24d035b383 Merge branch 'blender-v2.90-release' into master 2020-07-30 14:21:54 +10:00
1f48e67002 Merge branch 'blender-v2.90-release' into master 2020-07-30 14:21:49 +10:00
422e5e372e Merge branch 'blender-v2.90-release' into master 2020-07-30 14:21:41 +10:00
0ab66dd63f Fix T79369: BMesh.calc_volume() gave incorrect result 2020-07-30 14:20:18 +10:00
69ec7ab873 UV: path select support with sync-select enabled
Also improve region fill with edge-select enabled which often failed
to include both vertices from each edge in the resulting region.
2020-07-30 12:07:10 +10:00
ff0112bcb2 Fix UV select with sync select enabled wasn't setting active 2020-07-30 11:02:03 +10:00
dc3baf2c78 Cleanup: spelling 2020-07-30 08:43:40 +10:00
929c94ee20 Cleanup: warnings 2020-07-30 08:43:40 +10:00
2181028292 Merge branch 'blender-v2.90-release' 2020-07-29 19:19:25 -03:00
699cefefd0 Fix ghash return value on 'Correct Face Attributes' with 'Keep Connect'
The result was somewhat unpredictable.
This error was recently introduced.
2020-07-29 19:17:56 -03:00
486c7b87fb Cleanup: GPU: Remove GPU_draw.h and move fluid gpu function to DRW 2020-07-29 23:21:33 +02:00
5f6fb5bb41 Cleanup: Split gpu_texture_image.c into BKE and IMB modules
This is in order to disolve GPU_draw.h into more meaningful code blocks.

All the Image related function are in `image_gpu.c`.
All the MovieClip related function are in `movieclip.c`.

The IMB module now has a connection with GPU. This is not strickly
necessary and the code could be move to `image_gpu.c` if needed.

The Image garbage collection is also ported to `image_gpu.c`.
2020-07-29 23:06:37 +02:00
7e8d493730 GPU_draw.h: cleanup before splitting 2020-07-29 23:06:37 +02:00
c09f61a915 RNA: Image API: Fix error in NULL check in rna_Image_gl_touch
This check was always returning true.
2020-07-29 23:06:37 +02:00
5f46a0fbce Cleanup: Rename define
*_LEN follows names elsewhere in Blender more closely than "_N_"
2020-07-29 17:01:46 -04:00
81ce8481b2 Fix failing PLY test, update hash because metadata changed 2020-07-29 19:49:53 +02:00
8c10e56331 Sculpt: Cloth Brush Soft Body Influence property
This property adds constraints to the simulation using the initial
location of the vertices, making it behave like a soft body. The
strength of these constraints can be modified with the brush parameter.
This makes some deformation modes more subtle and predictable, making it
possible to use the cloth brush to add surface detail in a more
controllable way without loosing completely the original shape of the
mesh.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D7845
2020-07-29 19:14:03 +02:00
ebda95953c Merge branch 'blender-v2.90-release' 2020-07-29 18:22:33 +02:00
3274ce0a8e Fix T79119: Hook modifier deformation not shown in edit mode.
Missing temp `BKE_mesh_wrapper_ensure_mdata` hack for the Hook
modifier...
2020-07-29 18:21:27 +02:00
f62c7c546a Merge branch 'blender-v2.90-release' 2020-07-29 17:39:59 +02:00
Bastien Montagne
4e6975ffd6 Fix T78285: Invalid thread safety in shrinkwrap modifier code.
This uses mesh's runtime mutex for both `BKE_mesh_runtime_looptri_ensure`
(was using its own global RW mutex before), and `BKE_mesh_wrapper_ensure_mdata`
(was not protected at all before).

This is more like a band-aid than a proper fix, as mentioned in the report
proper fix would be for the modifier to request those data (the relevant
BVHTree, which would implicitely also call the tow others) through flags,
just like it does for regular CDData layers. But this is a much bigger
refactor to be done outside of bugfix scope.

Reviewed By: sergey

Maniphest Tasks: T78285

Differential Revision: https://developer.blender.org/D8415
2020-07-29 17:36:46 +02:00
03acbc7b71 Merge branch 'blender-v2.90-release' 2020-07-29 17:22:50 +02:00
54a2fcc0f3 Fix Cloth Brush global Sculpt gravity applied in the wrong falloff
Previously, gravity was only applied in the real brush radius, not in
the whole simulation radius. For most deformation modes, applying
gravity to the entire simulation instead of just to the brush radius and
scaled by the radius (like a regular sculpt brush) makes more sense.
After this fix and with the cloth collisions patch applied, it is possible
to do things like this with the cloth grab brush.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D8406
2020-07-29 17:21:41 +02:00
6e5278c3da Fix T79054: Crash with Cloth Brush and anchored stroke
As the comment says, anchored stroke can't rely on the first stroke
iteration for creating the simulation data. Probably lost in a cleanup.

I also made that anchored stroke doesn't restore the mesh state in the
cloth brush, so it can create the simulation effect.

Reviewed By: sergey

Maniphest Tasks: T79054

Differential Revision: https://developer.blender.org/D8348
2020-07-29 17:19:10 +02:00
83f01db7a9 Compositor: Fix node preview when input resolution is not known
The final render will use scene resolution in this case.

For example, when Color Input is plugger to preview and composite output
nodes, final render will flood-fill the final image which is a size of
scene resolution with this color. Before this fix the node preview was
empty. After this fix the node preview will be flood-filled with the
color.

Fixes T78586

Differential Revision: https://developer.blender.org/D8263
2020-07-29 17:18:35 +02:00
66df8fff32 Compositor: Fix calculation of preview resolution
Were two issues:

- Divider was calculated in integer domain, causing rounding issues in
  general case, and causing singularity in a corner case when input is
  smaller than the preview size.

- The resolution was scaled down by 1 pixel for no obvious reason.
2020-07-29 17:18:35 +02:00
b9c7c904ed GPUShader: Fix linking with MSVC 2020-07-29 16:07:51 +02:00
f0687d4665 Cleanup: GPUTexture: Use UNPACK3 in texture_fluid 2020-07-29 15:54:51 +02:00
1804a6d040 GPUState: Fix compilation error on MSVC 2020-07-29 15:54:51 +02:00
2d89cd7dd5 Cleanup: GPU: Move Image based function to GPU_draw.h
This makes it less confusing what functions are for blender
structures.
2020-07-29 15:54:51 +02:00
99d0b3b793 Cleanup: GPU: Rename gpu_texture_smoke to fluid, and move back to C
The file do not have a reason to be C++ anymore.
2020-07-29 15:54:51 +02:00
7becd283cc GPencil: New Brush predefined mode
it's good to have an option to ' pin' a mode to the brush, to use that mode always, independent of the current viewport selected mode.

{F8723224}

Reviewed By: pepeland

Differential Revision: https://developer.blender.org/D8399
81a002
2020-07-29 15:34:54 +02:00
ade7603379 Cleanup: Remove deprecated comment. 2020-07-29 15:30:10 +02:00
e2e87efea2 Cleanup: Always keep unlock at same level as lock.
This was fine in those cases with current code, but that kind of
assumption is always risky, and an open door to hard-to-track bugs when
code changes in the future...
2020-07-29 15:30:10 +02:00
e749643793 GPU: Refactor gpu_texture_image to not use GL calls
This is also a bit of code cleanup, reorganisation.

Tried to be DRYed but avoid too much code change to (hopefully) minimize
breakage.

- GPU: remove TEXTARGET_CUBE_MAP, this is no longer used in the codebase.
- GPUTexture: Move compressed texture upload to gpu_texture.cc
- GPUTexture: Add per texture Anisotropic filtering switch
2020-07-29 15:03:02 +02:00
e4ee9de638 GPU: Move gpu_shader.c to C++
We split builtin shader support to its own file to avoid
converting code (lack of designated initializer in C++)
and to reduce file size.
2020-07-29 15:03:02 +02:00
18d2db22ff GPU: Move gpu_state.c to C++ 2020-07-29 15:03:02 +02:00
45d61bdc03 GPU: Move gpu_texture.c to C++
# Conflicts:
#	source/blender/gpu/GPU_texture.h
2020-07-29 15:03:02 +02:00
56d0a554a8 GPU: Move gpu_uniformbuffer.c to C++
This also rewrite and simplify the module a bit.
2020-07-29 15:03:02 +02:00
f84342d7e1 GPU: Move gpu_vertex_buffer.c to C++ 2020-07-29 15:03:02 +02:00
959529d4b8 GPU: Move gpu_vertex_format.c to C++ 2020-07-29 15:03:02 +02:00
18caaff149 Merge branch 'blender-v2.90-release' 2020-07-29 09:10:07 -03:00
84f7de432c Fix T78826: Move constraint is not fully disabled
Caused by rB45f17e10ec50
2020-07-29 09:09:34 -03:00
9c807325dd Particles: rename Size attribute to Radius
Doing this change for consistency with the point cloud attributes.
2020-07-29 12:03:30 +02:00
91150c9ef5 Workbench/Eeevee: Minor refactor in smoke draw function
More concise this way.
2020-07-29 11:22:35 +02:00
659db0592d GPencil: Consider extrude point as last
Before, when extrude a point, the extruded point is considered as the first point of the stroke, but this was not logic.

Now, the extrude point is considered as last.

Related to T79313
2020-07-29 11:19:35 +02:00
4cad74e589 Particles: add Size attribute 2020-07-29 10:05:27 +02:00
3e82500509 Fix T79355: switch to texture paint workspace changes image in other workspaces
Only automatically change image in editor to follow texture paint editors and
workspaces that are visible.
2020-07-29 09:06:23 +02:00
7a07683060 Cleanup: rename uiBut.dt, uiBlock.dt to 'emboss'
Use 'emboss' instead of 'draw_type' as enum, layout & functions use
the term emboss.

This issue was noted by @Poulpator in D8414, as `dt` is also an
abbreviation for delta-time.
2020-07-29 12:05:27 +10:00
a3c6304a27 Cleanup: quiet possible comma misuse warning in feestyle PyAPI 2020-07-29 11:00:32 +10:00
1e76441dd6 Clanup: unused return 2020-07-29 10:50:43 +10:00
dcad6c9db8 Cleanup: correct assert in GPU_offscreen_read_pixels 2020-07-29 10:50:31 +10:00
ac6fbf6ba8 Cleanup: declare static variables 2020-07-29 10:50:10 +10:00
012ed9ca9f Fix incorrect flag check in overlay relationship lines 2020-07-29 10:45:53 +10:00
nutti
0f075c25c4 Docs: add translation keyword argument default for msgctxt 2020-07-29 10:01:42 +10:00
nutti
55c6cc46b5 Fix RST syntax for freestyle documentation 2020-07-29 09:49:08 +10:00
7dfc2f5137 Cleanup: Doxygen sections, comment formatting 2020-07-28 17:20:41 -04:00
a0bc3596f0 Cleanup: class -> struct 2020-07-28 20:56:45 +02:00
cd3be9c46d Cleanup: too small loop variable 2020-07-28 20:56:34 +02:00
c3f6227f30 Cleanup: Use bool instead of int 2020-07-28 14:24:25 -04:00
e5e97d0fe0 Merge branch 'blender-v2.90-release' 2020-07-28 18:46:38 +02:00
d8919d12f7 GPencil: Fix typo error in RIM VFX panel
The vertical axis must be named Y, not Z because it works in 2D space.
2020-07-28 18:46:22 +02:00
814ca40c63 Merge branch 'blender-v2.90-release' 2020-07-28 16:37:01 +02:00
fcf91bbf0d Merge branch 'blender-v2.90-release' 2020-07-28 18:32:11 +02:00
9c1da81a4c Fix T54544: "Copy Materials to Selected" only works when materials are defined on the mesh.
Build a temp matarray storing materials from obdata and source object
(depending on slots 'allocation' of source object), and assign those to
targets.

Also remove limitation of 'using same obdata is forbidden', just never
edit obdata materials in that case...

Certainly not perfect, but already much better than existing code.
2020-07-28 18:31:51 +02:00
cf243e0980 Merge branch 'blender-v2.90-release' 2020-07-28 17:56:26 +02:00
5d88f8eba2 Fix T61607: OpenEXR files with less common RGB channels names not loaded
Previously there would have to be 3 channels R,G,B. Now also support cases
where there are fewer channels or other names like Red, AR and RA are used.
2020-07-28 17:55:37 +02:00
556252f1fe Fix T79067: Cycles panorama viewport render stretched after recent changes 2020-07-28 17:34:51 +02:00
80539723b9 Fix T79219: Cycles NLM denoiser clean passes broken after recent changes 2020-07-28 17:34:44 +02:00
67c33caeec Fix: remove error in previous commit 2020-07-28 16:35:31 +02:00
b274d18aec Cleanup: correct usage of extern-C blocks in various places
This removes extern-C blocks around other includes and adds
such blocks for some headers that need them.
2020-07-28 16:33:43 +02:00
cbeb2e55ed Merge branch 'blender-v2.90-release' 2020-07-28 16:24:53 +02:00
dcf7a05077 GPencil: Fix unreported missing strokes in interpolation
Sometimes the interpolated stroke was tagged and removed.
2020-07-28 16:23:45 +02:00
8fbed7f7f5 Merge branch 'blender-v2.90-release' 2020-07-28 15:46:09 +02:00
9ff7820f62 Fix T79259: OptiX render with fisheye camera is different to CUDA
The fisheye camera setup causes the edges of the image to not shoot primary rays. This was not
respected by OptiX because of an optimization that tried to reduce conditionals around trace calls.
Removing that does not seem to have an impact on performance anymore however and it fixes
the issue.
2020-07-28 15:45:46 +02:00
bc0b75ea37 Merge branch 'blender-v2.90-release' 2020-07-28 09:55:27 -03:00
5e232d7a0b Fix bad 'Correct Face Attributes' behavior when extruding faces
A face must have area in order to be possible calculate interpolation weights.
The same to the reference UVs.
But the new faces created with the extrude operator, have no area (before moving).

The solution was to get the loop data from some neighbor face.

Differential Revision: https://developer.blender.org/D8278
2020-07-28 09:53:44 -03:00
6a689b5047 Transform: Correct Face Attributes: Option to merge attributes
Keeping face attributes connected is now optional.

Keeping UV's connected is useful for organic modeling, but bad for
architectural.

Differential Revision: https://developer.blender.org/D8360
2020-07-28 09:53:23 -03:00
47b82fc02f Fix precision issues in 'interp_weights_poly_v2'
These precision issues were evident in corrected uvs when the option
`"Correct Face Attributes"` is enabled.
2020-07-28 09:53:07 -03:00
26bc8f4935 Merge branch 'blender-v2.90-release' 2020-07-28 14:44:54 +02:00
b99358315e Fix T79180: Object disappears when scaled, set origin etc after applying smooth modifier.
Very dummy mistake in modifier code would generate invalid number
(divisions by zero)...

Should also be ported to 2.83.
2020-07-28 14:44:17 +02:00
76d489fe23 Bump minimum CMake version to 3.10
This bumps the minimally required CMake version from 3.5 to 3.10, as
discussed in D8405.

Since D7649 landed, there has been the `gtest_discover_tests()` call to
discover individual unit tests in `bin/tests/blender_test`. This
function was introduced in CMake 3.10.

Since there were no complaints about this incompatibility, I suspect
that a newer version is already in use by the majority of the
Blender-building people.
2020-07-28 14:17:13 +02:00
9d412a92f5 Cleanup: incorrect spelling of 'manhattan' 2020-07-28 22:06:44 +10:00
2a52c2d001 Cleanup: spelling, comments 2020-07-28 21:49:37 +10:00
82c38a7df0 Fix T79067: Cycles panorama viewport render stretched after recent changes 2020-07-28 13:35:45 +02:00
75e16c22d7 Fix T79219: Cycles NLM denoiser clean passes broken after recent changes 2020-07-28 13:16:44 +02:00
f0c4566ce3 Merge remote-tracking branch 'origin/blender-v2.90-release' 2020-07-28 12:40:05 +02:00
ec80f1d376 Cleanup: Commented BKE_object_moves_in_time() does not consider physics
When an object is moved only by the rigid body physics system, the
function `BKE_object_moves_in_time()` will incorrectly return `false`.
This commit adds a comment to make this behaviour more explicit.

No functional changes.
2020-07-28 12:39:52 +02:00
19de9d1a9e Cleanup: spelling fix in comment 2020-07-28 12:39:52 +02:00
050de1fb8e Fix T79263: Alembic, exported rigid body animation not moving
The root cause was that `BKE_object_moves_in_time()` incorrectly returns
`false` when an object is moved by the physics system.

This also fixes the same issue in the USD exporter.
2020-07-28 12:38:31 +02:00
3b9e16a4f7 Particles: initial support for the Time input node 2020-07-28 12:10:37 +02:00
c8e45c3fe9 Merge branch 'blender-v2.90-release' 2020-07-28 12:02:59 +02:00
d738e47b0d Clip Editor: Make filter labels consistent
This was done for the regular dopesheet in rB9ccc73ade8a2, this just
makes that label consistent across all anim views.

Differential Revision: https://developer.blender.org/D8255
2020-07-28 12:00:47 +02:00
34125ce507 Merge branch 'blender-v2.90-release' 2020-07-28 11:54:51 +02:00
e296c9e24e Fix T79031: Batch Generate-Previews doesn't work anymore
Caused by rB19785b96c43f.

Maniphest Tasks: T79031

Differential Revision: https://developer.blender.org/D8400
2020-07-28 11:52:38 +02:00
8a60e920f4 Merge branch 'blender-v2.90-release' 2020-07-28 11:47:55 +02:00
290b372aac Fix T79264: Mantaflow Field weights cannot be animated
rna_EffectorWeight_path() needs to point to "domain_settings" (instead
of "settings"), was a missing change when switching the FluidModifier to
mantaflow.

Maniphest Tasks: T79264

Differential Revision: https://developer.blender.org/D8398
2020-07-28 11:36:07 +02:00
da32c17631 Merge remote-tracking branch 'origin/blender-v2.90-release' 2020-07-28 11:08:10 +02:00
617e67529c Tests: show debugging hint when USDStageCreationTest fails
Setting the environment variable `PXR_PATH_DEBUG` non-empty will make the
USD library print the directories it uses to find its JSON files. This can
aid in debugging when this unit test fails. Now the failure message also
tells you about this.

No functional changes.
2020-07-28 11:02:05 +02:00
e7dd89b50b Cleanup: remove redundant return statement
This was found by clang-tidy.
2020-07-28 11:00:08 +02:00
1675969152 Merge branch 'blender-v2.90-release' 2020-07-28 17:57:56 +10:00
a2a29327d9 Fix T79341: Crash evaluating curve 2020-07-28 17:53:22 +10:00
289aac723a Merge branch 'blender-v2.90-release' 2020-07-27 21:17:03 -06:00
ed19781a2a Fix T77951: Remove duplicate outliner menu entries
Move the common entries (View and Area) into a static method to be
called from other menus to avoid duplicating the New Collection and ID
Paste operators.
2020-07-27 21:08:28 -06:00
6ad75949b9 Fix: Wrong outliner restrict column for gpencil layer hide
The icon was drawing in the viewport disable rather than the viewport
hide column. Unreported.
2020-07-27 20:07:55 -06:00
ace832bf7c Merge branch 'blender-v2.90-release' 2020-07-27 22:21:57 +02:00
221604cdd6 Fix Sculpt Relax operation when deforming mesh boundaries
Previously, mesh boundaries were relaxed as any other vertex, which was
causing artifacts and unwanted deformation. In order to prevent this,
the mesh filter was using the automasking system to lock the boundary
vertices, which was hacked into the tool. For the brush, the only
solution was to enable boundary automasking to lock those vertices
in plance.

Now the relax vertex function slides the boundary vertices along the
mesh boundary edges, relaxing all the topology correctly while
preserving the shape of the mesh. The automasking hack in the relax
mesh filter was also removed as now vertices slide correctly along
the boundary.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D8350
2020-07-27 22:19:35 +02:00
0006526952 Fix T79074: Mesh Topology info not being updated after changes
All these data arrays are created for a specific topology, so they should be
freed and updated when the PBVH rebuilds. Previously, this was only
happening when freeing the SculptSession, but it also needs to happen in
BKE_sculpt_update_object_before_eval to avoid reusing out of date data.

Reviewed By: sergey

Maniphest Tasks: T79074

Differential Revision: https://developer.blender.org/D8357
2020-07-27 22:04:31 +02:00
7eebebebc7 Fix T79164: Sculpting with smooth shading doesn't update normals
Just a missing update flag

Reviewed By: sergey

Maniphest Tasks: T79164

Differential Revision: https://developer.blender.org/D8364
2020-07-27 22:02:35 +02:00
4f3233dd53 Fix T78242: Crash when using a Sculpt color tools that needs connectivity for the first time
When there is no color layer available,
BKE_sculpt_update_object_for_edit creates a new one and tags the mesh
with ID_RECLAC_GEOMETRY, so this layer is inmediatly available when the
tool starts. This also deletes the PBVH and when it is created again in
BKE_sculpt_update_object_after_eval, the pmap is not initialized, making
the tool crash.

This moves the color layer creation to a separate function outside
BKE_sculpt_update_object_for_edit, which now runs after the color
layer is available, so it won't need to update again and the pmap will
still be available when the tool is used.

Reviewed By: sergey

Maniphest Tasks: T78242

Differential Revision: https://developer.blender.org/D8135
2020-07-27 21:58:59 +02:00
a0b0a47d81 GPencil: Scale stroke thickness when use Offset modifier scale 2020-07-27 19:09:44 +02:00
e8869d9c71 Merge remote-tracking branch 'origin/blender-v2.90-release' 2020-07-27 19:02:44 +02:00
2584a2a4e7 Fix USD unit test on buildbot
The buildbot uses a separate `CMAKE_INSTALL_PREFIX`. This means that
the unit test could not find its USD JSON files in the build directory.
Using `${CMAKE_INSTALL_PREFIX}` instead of `$<TARGET_FILE_DIR:blender>`
solved this.
2020-07-27 19:02:22 +02:00
e893430a63 Partly revert "Fix T77276: Generating Python API docs raises many warnings"
This commit reverts the "noindex" part of the original commit.
using noindex made it imposible to link to a specific property.

The original warnings do not pose an issue so until a proper solution is 
found I am reverting this commit.

This reverts commit 953c232db3
2020-07-27 13:01:28 -04:00
729da8bfac CTest: Fix blender_test not working on windows.
MSVC does need the wholearchive flag but it was not set,
so no tests were actually linked into the binary.

Reviewed By: sybren

Differential Revision: https://developer.blender.org/D8404
2020-07-27 10:55:34 -06:00
e54289cdf3 Merge branch 'blender-v2.90-release' 2020-07-27 18:15:56 +02:00
1ae8855f8e Fix T78308: Weight Transfer Operator "Deform Pose Bones" destination setting doesn't work.
Some modes were working by mere chance in that ugly 'reversed' case, but
the to/from selection modes were not properly swapped...

Should also be safe for 2.83.
2020-07-27 18:12:40 +02:00
7fd68db841 Merge branch 'blender-v2.90-release' 2020-07-27 17:40:10 +02:00
960ce1e394 Fix T78306: Weight Transfer Operator target mesh doesn't update when transforming bones.
Data transfer operator was missing tagging DEG for relations updates.

Should be portable to 2.83 as well.
2020-07-27 17:39:49 +02:00
2e376cfcc8 Merge remote-tracking branch 'origin/blender-v2.90-release' 2020-07-27 17:32:28 +02:00
a5b2aa96e4 CMake: reject older GCC version when using precompiled Linux libraries
In the situation where the precompiled libraries are used on Linux +
GCC, a version of GCC older than 9.3 is guaranteed to cause problems.

This just implents a fatal error message when we know it doesn't make
sense to continue. We could do more checks and add some warnings, but
it's very likely that these will be ignored amongst the other noise.

Reviewed By: sergey, brecht

Differential Revision: https://developer.blender.org/D8396
2020-07-27 17:29:13 +02:00
9a53d4a882 Particles: support Clamp node 2020-07-27 17:12:15 +02:00
bd4b29d63d Cleanup: fixed compiler warning about strncat
`strncat(command, "x", 1)` is the same as `strcat(command, "x")`, except
that the latter form doesn't trigger a GCC warning.

No functional changes.
2020-07-27 17:03:32 +02:00
c7ee66e517 Cleanup: remove outdated comment 2020-07-27 16:42:04 +02:00
6f5d01779a Functions: add some tests for virtual spans 2020-07-27 16:35:54 +02:00
38e65331a8 Particles: initial support for events and actions
The following nodes work now (although things can still be improved of course):
Particle Birth Event, Praticle Time Step Event, Set Particle Attribute and Execute Condition.

Multiple Set Particle Attribute nodes can be chained using the "Execute" sockets.
They will be executed from left to right.
2020-07-27 16:26:43 +02:00
a83bb170b0 Merge branch 'blender-v2.90-release' 2020-07-27 16:18:44 +02:00
d64e171c4b Cycles: Enable OptiX on first generation Maxwell GPUs again 2020-07-27 16:11:00 +02:00
4c5e1f1c25 Merge remote-tracking branch 'origin/blender-v2.90-release' 2020-07-27 15:49:02 +02:00
79312962de Cleanup: Fix compiler warning about function without prototype
No functional changes.
2020-07-27 15:48:47 +02:00
81a0027f13 Merge remote-tracking branch 'origin/blender-v2.90-release' 2020-07-27 15:26:08 +02:00
f8a0a5a350 PointCloud: Fix viewport issue when using radius attrib after not using it
This was a simple issue with the static GPUVertFormat being the same for
both cases.
2020-07-27 15:41:16 +02:00
71506698de Cleanup: Fix compiler warning about missing parentheses
The code was well-defined, given that `&&` binds stronger than `||`, but
still GCC warns about this.

No functional changes.
2020-07-27 15:25:33 +02:00
565d7f75cc UI: improve errors when evaluating a number button fails
Showing the Python error without any explanation is often
not enough information and doesn't hint that the error was in the
user input.

The error report from a invalid expression such as '..1' used to be:
   ('invalid syntax', ('<string>', 1, 1, '..1'))

Now reads:
   Error evaluating number, see Info editor for details: invalid syntax

Address issue raised by T78913.
2020-07-27 21:00:50 +10:00
7beef1fd33 PyAPI: simplify syntax error reports
The result of syntax errors read poorly in reports,
resulting in cryptic and unhelpful information.

Change PyC_ExceptionBuffer_Simple only to extract the initial text,
making syntax errors when entering invalid numeric expressions into
buttons easier to follow.
2020-07-27 21:00:50 +10:00
d7cb67454d Cleanup: match call signature for UI unit number evaluation
Also rename ui_but_string_set_eval_num to ui_but_string_eval_number
as it doesn't set any of the buttons values.
2020-07-27 21:00:49 +10:00
9ce2c5bf50 Cleanup: remove workaround for old BLI_dynstr_vappendf bug
Remove workaround from 1c806f6bb4
as this doesn't seem to be needed anymore.
2020-07-27 21:00:49 +10:00
b18c376946 Cleanup: quiet warnings without DDS 2020-07-27 21:00:49 +10:00
0b04f0e4e6 GPU: Fix crash and missing texture due to recent C++ port
Fix T79306 DRW: small issues with yesterday commits modifying TEXTARGET
Fix T79303 Image texture node crashes EEVEE when connected to a shader output
2020-07-27 13:37:22 +02:00
bfeb94eccc Cleanup: quiet warning 2020-07-27 11:41:51 +02:00
418753b6a6 GPU: fix build error due to wrong linkage specification 2020-07-27 11:40:47 +02:00
382b9007f8 GPencil: New operator to Cleanup duplicated frames
This operator cleanup any frame that is equal to the previous one. This is very handy when convert a mesh animation to Gpencil and the mesh is static for several frames.

Differential Revision: https://developer.blender.org/D8149
2020-07-27 10:47:04 +02:00
f31fa3eb97 Merge branch 'blender-v2.90-release' 2020-07-27 10:32:38 +02:00
ea4a00e93b Fluid: Fix warnings from max particle option
-Wreorder was the issue.
2020-07-27 10:32:12 +02:00
93e6ed9b45 Merge branch 'blender-v2.90-release' 2020-07-27 10:26:00 +02:00
d906116eba Cleanup: comments. 2020-07-27 10:25:43 +02:00
041904ceb8 Cleanup: Minor renaming. 2020-07-27 10:25:43 +02:00
40a9524637 Merge branch 'blender-v2.90-release' 2020-07-27 10:24:53 +02:00
87fb12d16e Allocator: fix build error with -Werror=format-security
Doing it again here, because I fixed this only in master branch before..
2020-07-27 10:23:20 +02:00
6d42ffe03c Merge remote-tracking branch 'origin/blender-v2.90-release' 2020-07-27 09:06:00 +02:00
9b867f2e90 Fix T79121: Dependency cycle when driver points to prop with 'scale' in name
This makes `RNANodeQuery::construct_node_identifier()` more strict in
its matching of certain property names.

The downside of this approach is that it's not possible any more to use
`"rotation"` and expect a match for `"rotation_euler"` and friends, so
the list of strings to test against is now 3x as long.

Reviewed By: sergey

Maniphest Tasks: T79121

Differential Revision: https://developer.blender.org/D8375
2020-07-27 08:53:32 +02:00
3bcec7c142 Cleanup: Alembic, fix maybe-uninitialized warning
No functional changes.
2020-07-27 08:52:53 +02:00
d62250a3e0 UI: Show message in transform panel when no metaball elements are selected
The complete lack of a transform panel was confusing enough to spawn
this question: https://blender.stackexchange.com/q/169074/599
Displaying a message instead of nothing is more consistent with the
behavior of the mesh transform panel anyway.

Reviewed By: Blendify

Differential Revision: https://developer.blender.org/D8390
2020-07-26 21:20:37 -04:00
9e7ee39385 Merge branch 'blender-v2.90-release' 2020-07-26 21:09:24 -04:00
344be1fcfa RNA to Manual: Update links 2020-07-26 21:06:35 -04:00
ba9c88ce18 GPUFramebuffer: Fix compilation issue with designated initializer in C++ 2020-07-27 00:08:48 +02:00
2c2082cc62 GPU: Fix MSVC compile errors 2020-07-26 23:50:29 +02:00
e76f64a532 Fluid: Added new option to control the maximum number fluid particles in the simulation
New option that lets users the define the maximum number of fluid particles that will be allowed in the simulation. This can come in handy, for example, to ensure that the particle count will not exceed the hardware capabilities, or to avoid excessive amounts of particles in a scene.
2020-07-26 22:04:59 +02:00
c9cc5ad1c0 Fluid: Updated Mantaflow source files
New files contain updated sampling function (support for maximum number of particles cap).
2020-07-26 22:04:59 +02:00
65e1d43f0b Fluid: Cleanup unsed file format options
File format options for noise and particles are not needed anymore (since OpenVDB update).
2020-07-26 22:04:59 +02:00
04195b1e74 Fluid: Added new option to control the maximum number fluid particles in the simulation
New option that lets users the define the maximum number of fluid particles that will be allowed in the simulation. This can come in handy, for example, to ensure that the particle count will not exceed the hardware capabilities, or to avoid excessive amounts of particles in a scene.
2020-07-26 22:02:10 +02:00
2ebf263f5c Fluid: Updated Mantaflow source files
New files contain updated sampling function (support for maximum number of particles cap).
2020-07-26 22:02:10 +02:00
9386dd66ff Fluid: Cleanup unsed file format options
File format options for noise and particles are not needed anymore (since OpenVDB update).
2020-07-26 22:02:10 +02:00
94afe7671c Cleanup: GPU: Remove glew headers part2 2020-07-26 21:07:25 +02:00
54237994d8 Cleanup: Image: Rename redundant enum for clarity 2020-07-26 21:07:25 +02:00
487eaeed7e GPUTexture: Replace GL textarget enum by Image enum 2020-07-26 21:07:25 +02:00
025dc31d28 GPU: Remove GL constant from BIF_glutil 2020-07-26 21:07:25 +02:00
18cca0e704 Cleanup: GPU: Remove GPU_glew.h outside of GPU module
Remove use of GL* constants and types inside the codebase. There is still
a few occurence to get rid of.
2020-07-26 17:29:49 +02:00
9e23dbd060 Cleanup: GPU_codegen.c: Use LISTBASE_FOREACH macro instead of for loops 2020-07-26 17:28:48 +02:00
15655aa1dd Cleanup: GPU: Remove unused code and header 2020-07-26 17:28:48 +02:00
cc7d5e1fe6 GPU: Move gpu_platform.c to C++ 2020-07-26 17:28:48 +02:00
c276ef61d4 GPU: Move gpu_immediate.c to C++ 2020-07-26 17:28:48 +02:00
b296b68ff2 GPU: Move gpu_framebuffer.c to C++ 2020-07-26 17:28:48 +02:00
9905db5557 GPU: Move gpu_extensions.c to C++ 2020-07-26 17:28:48 +02:00
7c3eaffbbd GPU: Move gpu_element.c to C++ 2020-07-26 17:28:48 +02:00
97b597cd04 GPU: Move and rename gpu_draw*.c to C++
`gpu_draw.c` was a misleading name, `gpu_texture_image.cc` is better
suited.
2020-07-26 17:28:48 +02:00
8b7802db85 GPU: Move gpu_debug.c to C++ 2020-07-26 17:28:48 +02:00
56803e2754 GPU: Rename gpu_context.cpp to .cc suffix 2020-07-26 17:28:48 +02:00
7b4a21077a GPU: Move gpu_batch.c to C++ 2020-07-26 17:28:48 +02:00
d3cecc5007 GPU: Move gpu_attr_binding.c to C++ 2020-07-26 17:28:48 +02:00
13afc81f6d BLI: Add MACRO for enum usage in C++
This is handy to add support for enums used in both C and C++
files. This removes the need to typecast each time for every
operation.

Only support bitwise operators for now.
2020-07-26 17:28:48 +02:00
a77175c9b6 GPU: Add extern "C" to intern headers 2020-07-26 17:28:48 +02:00
076d033e10 VSE: Refactor delete operator and API
Operator logic is limited to iterating over selection and executing
same code as python API does.

Functional changes:

 - No attempt to preserve effects is made. Dependant effects are deleted.
 - No attempt to change meta strip boundaries.

Partially fixes T73828

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D6892
2020-07-26 16:07:34 +02:00
f0e370a650 Merge branch 'blender-v2.90-release' 2020-07-26 15:04:56 +02:00
7ceb6ffe57 Fix T74958: Infinite loop on using strip as modifier mask
Add recursion check before assigning strip as a mask for modifier.
Same check is used for recursion check when reassigning effect input, so it
should not be possible to create recursion at all.
2020-07-26 15:00:37 +02:00
f2907b06f4 Fix T78999: Crash when adjusting sequencer property
Sequencer was not initialized yet, and RNA update function tried to clean up cache.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D8323
2020-07-26 15:00:37 +02:00
5414ccbd4c Merge branch 'blender-v2.90-release' 2020-07-26 22:00:13 +10:00
28b1c70895 Fix T79272: Dimensions fail on negative scaled axis 2020-07-26 21:58:47 +10:00
850234c1b1 UV: port smart project from Python to C
Use C for faster operation on high poly models,
in my tests this gave ~27x speedup.

D8311 by @andreasterrius with edits.
2020-07-26 21:27:32 +10:00
9482cc6865 UV: support creating ParamHandle without checking UV selection
Needed for unwrapping from the 3D view.
2020-07-26 20:42:11 +10:00
fd7e31b3e5 Particles: don't mark Particle Attribute node as mockup
It is actually doing something already.
2020-07-26 12:32:28 +02:00
6cecdf2ade Functions: move tests closer to code 2020-07-26 12:19:11 +02:00
13abacaaf3 Particles: show which nodes are only mockups in the Add menu
More nodes will be implemented step by step. I don't remove/disable these nodes,
so that it is still possible to add them.
2020-07-25 21:01:57 +02:00
14326619a1 Cleanup: avoid using namespace name in many cases 2020-07-25 20:39:21 +02:00
1e999c7bdb Particles: initial Quick Particles operator
This operator automates the following steps:
1. Create a point cloud object.
2. Create a simulation data block.
3. Add a small particle simulation to the node tree.
4. Add a Simulation modifier to the point cloud object.
5. Reference the particle simulation from the modifier.

You have to go back to frame 1 to start the simulation.
The simulation is not yet cached and cannot be rendered.

The bounding box of the point cloud object is enabled for now,
because otherwise it is hard to select the object.
2020-07-25 20:24:36 +02:00
04d46bdb83 Pointcloud: workaround for a viewport drawing issue 2020-07-25 20:19:55 +02:00
89f4191a53 Allocator: fix build error with -Werror=format-security 2020-07-25 15:10:24 +02:00
0ae2a1d12a Particles: improve emitter when object is animated 2020-07-25 14:51:15 +02:00
d52e45c89e Merge branch 'blender-v2.90-release' 2020-07-25 21:31:16 +10:00
a8d058dbf4 Fix T79260: Crash displaying the same mesh in two windows 2020-07-25 21:30:08 +10:00
790d3804d0 Merge branch 'blender-v2.90-release' 2020-07-25 20:50:38 +10:00
4ca8f25fa8 Fix T79239: UV path select crash 2020-07-25 20:48:40 +10:00
82db64ed80 Merge branch 'blender-v2.90-release' 2020-07-25 20:36:31 +10:00
537c57136f Fix T79254: FCurve editor crash when zooming out to limit 2020-07-25 20:32:07 +10:00
eeaa4379aa Simulation: cleanup dna data 2020-07-25 11:54:06 +02:00
ddd4fec386 Merge branch 'blender-v2.90-release' 2020-07-25 17:19:49 +10:00
2308668bac Fix T72622: Transform object origin ignores shape keys
D8367 by @paul2t with edits.
2020-07-25 17:19:13 +10:00
273f50a333 Merge branch 'blender-v2.90-release' 2020-07-24 13:13:42 -03:00
d7c4e96493 Cleanup: Rename 'isect_ray_seg_v3' to 'isect_ray_line_v3'
The name was misleading as it returns true whenever it intersects the
line represented by the points.
2020-07-24 12:07:58 -03:00
9a117fcdae GPencil: Add more randomness to random stroke color
The old method produce a small range of similar colors.
2020-07-24 16:24:04 +02:00
704d581aea Merge branch 'blender-v2.90-release' 2020-07-24 15:39:11 +02:00
c64b12c0b8 Fix OptiX being shown as available on first generation Maxwell GPUs
The OptiX kernels are compiled for target "compute_sm_52", which is only available on second
generation Maxwell GPUs, so disable support for older ones.
2020-07-24 15:36:09 +02:00
50ff450202 Cleanup: can use guarded instead of raw allocator now 2020-07-24 13:47:57 +02:00
74fcb4d4c2 Particles: initial particle birth action
A particle action is some function that is triggered by some event.
Right now, users cannot control this. There is just a
randomize-velocity on-birth action. So the direction of spawned
particles is slightly randomized now.

This also adds a new integer attribute called "Hash" which is
useful for a number of things. Mainly for generating random numbers
for a specific particle. The ID of a particle is not necessarily a good source
of randomness.
2020-07-24 13:37:55 +02:00
f495b583be Merge branch 'blender-v2.90-release' 2020-07-24 12:40:20 +02:00
ec17b45034 Depsgraph: use construct on first use idiom for graph registry
This is necessary to avoid false positive memory leaks.
2020-07-24 12:38:04 +02:00
236ca8fbe8 Allocator: make leak detection work with static variables
When definining static variables that own memory, you should
use the "construct on first use" idiom. Otherwise, you'll get
a warning when Blender exits.

More details are provided in D8354.

Differential Revision: https://developer.blender.org/D8354
2020-07-24 12:26:11 +02:00
b53c46d760 BLI: add MultiValueMap
This is a convenience wrapper for `Map<Key, Vector<Value>>`.
It does not provide any performance benefits (yet). I need this
kind of map in a couple of places and before I was duplicating
the lookup logic in many places.
2020-07-24 12:15:13 +02:00
141deeefff DNA: disable 'int8_t' since it's not properly supported
Currently negative values from this type will be changed if the
int8_t changes to a int16_t for e.g.
2020-07-24 19:41:50 +10:00
22b8ac80d2 Merge branch 'blender-v2.90-release' 2020-07-24 11:24:57 +02:00
3886392430 Fix interface artifacts on Intel GPUs
This is a continuation of fix for T78307. Turns out instancing do not
work at all, so enforce single widget drawing on macOS and Intel GPU.

It was also reported that certain AMD and Mesa driver suffer from
similar issue, so disabled instancing for this configuration as well.

Differential Revision: https://developer.blender.org/D8374
2020-07-24 11:23:39 +02:00
13fa4b9898 Cleanup: remove redundant glReadBuffer call when reading pixels 2020-07-24 19:01:13 +10:00
1a5945e2c3 Merge branch 'blender-v2.90-release' 2020-07-24 16:21:47 +10:00
2bd2db120e Fix T79209: Empties have disabled viewport display settings 2020-07-24 16:20:30 +10:00
2a186af2b3 Merge branch 'blender-v2.90-release' 2020-07-24 15:58:30 +10:00
0e9999a93e Fix shape key pin toggle drawing as disabled in edit-mode
Pin can be used in edit-mode when shape key in edit-mode is enabled.
2020-07-24 15:55:11 +10:00
ba99b12287 Cleanup: use doxy sections, update comments missed from refactor 2020-07-24 13:58:32 +10:00
698af2e774 Try to fix build error
Not sure if this is the correct fix, because I can't reproduce the error.
2020-07-24 00:35:51 +02:00
0b50ea51cc Particles: simulate partial time steps on newly emitted particles 2020-07-23 23:03:19 +02:00
f359672c35 Particles: spawn particles on mesh surface 2020-07-23 22:30:22 +02:00
c049fe7979 Merge branch 'blender-v2.90-release' 2020-07-23 12:50:59 -06:00
9cbf43801b Fix T79187: Outliner "Make Single User" crash
When "ID Data" -> "Make Single User" is chosen with selected elements
that are not curves, there is a crash. This fix ensures that the id in the
callback function is an Action.
2020-07-23 12:40:33 -06:00
5ccb0f46dd Merge branch 'blender-v2.90-release' 2020-07-23 18:10:28 +02:00
954aa441bf Fix: Incorrect VR pose after changing landmark
Once the base pose was changed (e.g. by changing the active landmark), we'd always run the logic to reset to the base pose. That would mess up the final viewer pose.
Think this only got exposed through 607d745a79.
2020-07-23 18:08:24 +02:00
149bb0c26d Cleanup: unify naming between different spans 2020-07-23 18:07:44 +02:00
87c0a38a39 GPencil: Fix unreported missing frames in interpolation
When interpolate, the temp frames are tagged, and later removed. If for any reason any stroke was tagged in other area of Blender (this tag is used for temp tagging), the stroke could be removed by error when run interpolation.

In a previous fix, the tag was cleared before, but only for the frame range of the interpolation. Now, the clear is done for all frames.

Also, instead to clear for each stroke sampling, now it's done only once at invoke time.
2020-07-23 17:59:18 +02:00
766edbdf1f Particles: improve mesh emitter
Particles are now emitted from vertices of the mesh.
2020-07-23 17:57:11 +02:00
67857b5d9f Cleanup: avoid zero byte memcpy
Asan reports warnings because of this.
2020-07-23 17:55:05 +02:00
cf123da640 BLI: Add MutableSpan.copy_from method 2020-07-23 17:54:31 +02:00
4619562e2f Merge branch 'blender-v2.90-release' 2020-07-23 17:15:58 +02:00
ad586e7eeb LibOverride: Add update of overrides when reloading library data.
Pretty straight-forward, although it does not rebuild relationships
(this is a heavy process we do not want to automate for now, will be a
separate operator in near future).

Fix T78179: Library Overrides - Additional geometry not updating without reloading scene.
2020-07-23 17:15:32 +02:00
50cb693f1d Cleanup: Clang format. 2020-07-23 17:15:32 +02:00
ad6cfcef01 Fix (unreported) crash in reload library code related to shpaekeys.
Once again, we need lots of unatural twisting and convolutions to get
those nasty things to work...

Note that in previous versions of Blender, this would not crash, but was
still broken (shapekeys were never actually reloaded from libraries).
2020-07-23 17:15:32 +02:00
706b690ec6 Fix (unreported) bad handling of pointers in overrides with shapekeys. 2020-07-23 17:15:32 +02:00
6f3c37a3ff UI: Move properties tab list creation from RNA to editor
This is a change I pulled from the property-search-ui branch,
where I have to use the list of tabs to search the inactive tabs
and it makes more sense to use the array directly.

It is also an improvement to have this fundamental code to the
properties editor in the editor code rather than an RNA callback.

There are no functional changes.

Differential Revision: https://developer.blender.org/D8368
2020-07-23 11:01:59 -04:00
c9975d19b5 Merge branch 'blender-v2.90-release' 2020-07-23 15:47:47 +02:00
8d35dceb14 DNA: support fixed size integers
Reviewers: campbellbarton

Differential Revision: https://developer.blender.org/D8373
2020-07-23 15:42:45 +02:00
c8b24af1b2 BLI: move some tests into blenlib/tests
Reviewers: sybren

Differential Revision: https://developer.blender.org/D8315
2020-07-23 15:23:55 +02:00
ee98dc8d0f Fix T77277: building depsgraph inter-driver relations is slow
The extra depsgraph relations that were added to prevent threading
issues during evaluation (rB4c30dc343165) caused a considerable slowdown
on complex scenes with many drivers (T77277, T78615). This commit
improves this as follows.

Only the following drivers are considered for execution serialisation:
- Drivers on Array elements, and
- Drivers on Boolean or Enum properties.

Relations between drivers of the same arrays are added blindly, i.e.
without checking for transitive or cyclic relations. This is possible as
other relations will just target the `PROPERTIES_ENTRY` or
`PROPERTIES_EXIT` nodes.

Checking whether a driver is on an array is first done by checking
`array_index > 0`, and then falling back to resolving the RNA path to an
RNA property and inspecting that.

The code also avoids circular dependencies when there are multiple
drivers on the same property. This not something that is expected to
happen (both the UI and the Python API prevent duplicate drivers), it
did happen in a file (F8669945, example file of T78615) and it is easy
to deal with here.

Reviewers: sergey

Subscribers: mont29

Comment update
2020-07-23 14:52:46 +02:00
37ad90c35f Fix T29189 bevel crash.
New code to calculate UV islands made an incorrect assumption about
maximum stack size.
2020-07-23 08:44:34 -04:00
4ae24c0b57 Fix T79189 bevel crash.
New code to calculate UV islands made an incorrect assumption about
the maximum size of a stack.
2020-07-23 08:27:10 -04:00
be1969d2a4 Merge branch 'blender-v2.90-release' 2020-07-23 08:42:40 -03:00
b64ae920e4 Fix T79158: Eevee cubemaps shows black
Same as T75943 that was fixed by rBff97545c50f4
2020-07-23 08:41:35 -03:00
65aba4fc7a Fix T79158: Eevee cubemaps shows black
Same as T75943 that was fixed by rBff97545c50f4
2020-07-23 08:37:41 -03:00
634585aa68 Simulation: add depsgraph relations for ids referenced by node tree
I'll really have to refactor `ntreeUpdateTree` soon to avoid scanning
all node trees multiple times.
2020-07-23 12:09:36 +02:00
6596891121 Merge branch 'blender-v2.90-release' 2020-07-23 11:45:44 +02:00
bfeff73252 LibOverride: Add reset operations to the outliner menu. 2020-07-23 11:33:24 +02:00
60b80ce142 LibOverride: Add core functions to reset a library override.
This means that we delete all override properties except for those over
ID pointers *if* the assigned pointer matches the linked data hierarchy.

Then we reload affected datablocks.
2020-07-23 11:33:24 +02:00
79440c37ac LibOverride: Store RNA prop type in override properties.
Storing this info will help with dealing with reset operations and the
like (as we do not want to reset overrides of ID pointers essentially).
2020-07-23 11:33:24 +02:00
fa21ba0179 LibOverride: Outliner override creation: Better checks.
Enhance checks for which ID is valid for the override creation
operation.
2020-07-23 11:33:24 +02:00
d998258fa6 LibOverride: Make ID_IS_OVERRIDABLE_LIBRARY macro more correct. 2020-07-23 11:33:24 +02:00
ef17e7e51b LibOverride: Move override operations into own section of the ID outliner menu.
Also cleanup naming in outliner's override callbacks.
2020-07-23 11:33:24 +02:00
85157e74b3 LibOverride: Fix missing ID update tag in BKE_lib_override_library_update. 2020-07-23 11:33:24 +02:00
ad602a3f03 LibOverride: change runtime data into a real struct.
Needed for upcoming changes.
2020-07-23 11:33:24 +02:00
c8653e516d LibOverride: Optimize/fix new generic 'relation-based' make override code.
This commit mostly avoids following 'loop back' ID pointers, since those
should never define an actual relationship.
2020-07-23 11:33:24 +02:00
8a5da947dc Fix error in 'preferences.copy_prev' checking for the last version
The check to avoid updating between major releases prevented
2.90 files being copied to 2.91
2020-07-23 18:43:37 +10:00
944df0c784 Cleanup: remove incorrect comment 2020-07-23 10:39:22 +02:00
62e53788aa Merge branch 'blender-v2.90-release' 2020-07-23 17:35:40 +10:00
67002402bd Fix T79162: 'prop_search' includes ID prefix in string properties
Regression from d6cefef98f

This also fixes an unreported issue where finding an exact match
wasn't being detected for items that contained an ID prefix.
2020-07-23 17:24:17 +10:00
8438ef4d8e Cleanup: update comments, remove disabled code 2020-07-23 14:04:18 +10:00
19afb0ea67 Cleanup: remove redundant static variable use
This hasn't been needed since Python 3.7x.
2020-07-23 13:59:07 +10:00
797820fc20 Cleanup: replace wchar_t with char32_t 3D text accent input 2020-07-23 12:39:03 +10:00
ce4c2b8f0b Merge branch 'blender-v2.90-release' 2020-07-23 12:24:55 +10:00
4b31f4ace7 UI: disable add-object tool for 2.90 release
This needs improvements which need user testing before this can
be considered finished, even on a basic level.
2020-07-23 12:23:43 +10:00
e5cd770e9f Cleanup: rename Curve.len_wchar to len_char32
The name was misleading as the length is for char32_t, not wchar_t.
2020-07-23 11:50:03 +10:00
06e84fef88 Cleanup: unused argument 2020-07-23 11:39:49 +10:00
a51048a5d3 Simulation: add todo comment 2020-07-22 19:29:38 +02:00
4d6ac72264 Nodes: add missing update tags in the case of simulation node trees 2020-07-22 19:16:33 +02:00
e77644982c Depsgraph: build ids referenced by sockets 2020-07-22 19:16:33 +02:00
e0400d0a1c Simulation: move responsibility of updating persistent data handles
This solver should not be responsible for updating the handles.
2020-07-22 19:16:33 +02:00
0a5ef40c2c Simulation: fix memory leak 2020-07-22 19:16:33 +02:00
750899fd31 Simulation: improve depsgraph integration
A simulation data block has an embedded node tree, which requires
special handling in a couple of places. Some of those places were
missing beforehand.

This also adds a relation to make sure that the simulation is evaluated
after animations on the embedded node tree are evaluated.
2020-07-22 19:16:33 +02:00
921c95ab5e Fix T79144: Snapping bypassing the viewport backface culling
Silently activate the backface culling when the viewport is using.
2020-07-22 12:00:02 -03:00
72fc70879c Cleanup: Fix strict compiler warning 2020-07-22 16:52:00 +02:00
6f3ba033f8 Merge branch 'blender-v2.90-release' 2020-07-22 10:12:51 -04:00
0e280b96ca Fix T79160: Bevel modifier set to vertices by default
Need to properly initialize the affect_type field.
2020-07-22 10:02:52 -04:00
Nathan Letwory
5a1a4f4dd2 master is now 2.91.0 alpha. 2020-07-22 16:48:29 +03:00
Nathan Letwory
62a0e1d54f Merge branch 'blender-v2.90-release' 2020-07-22 16:47:26 +03:00
Nathan Letwory
a4e3943a08 Release branch is now in beta. 2020-07-22 16:41:29 +03:00
1fb9b6b1a1 UI: Use property split for simulation modifier 2020-07-22 09:16:17 -04:00
Nathan Letwory
0c0a9dabc7 Ensure submodules are at their correct commits. 2020-07-22 16:15:53 +03:00
4950022e7d Object: add-object option to place on the surface normal
Optionally use the surface normal under the mouse cursor.
2020-07-22 22:38:40 +10:00
980dd43bd4 Particles: give emitter its own state
High quality emitters need to maintain state themselves. For example,
this it needs to remember when it spawned the last particle.
This is especially important when the birth rate is changing over time.
Otherwise, there will be very visible artifacts.

It is quite likely that other components of the simulation need their own
state as well. Therefore, I refactored the `SimulationState` type a bit,
to make it more extensible. Instead of using hardcoded type numbers, a
string is used to identify the state type. Also, instead of having switch
statements in many places, there is a new `SimulationStateType` that
encapsulates information about how a specific state is created/freed/copied/...

I removed the integration with the point cache for now, because it was
not used anyway in it's current state.
2020-07-22 14:16:08 +02:00
47b6c33258 GPencil: New BKE function for setting random vertex color
This function is very handy for debug purposes.
2020-07-22 11:16:45 +02:00
Yevgeny Makarov
8f658ec27c UI: use term 'Vertex' instead of 'Vert' 2020-07-22 16:22:23 +10:00
ef52a9f791 Fix UV select flush error in recent loop select cleanup
Regression from d99b343b31
2020-07-22 16:02:46 +10:00
077a2f7bbb Cleanup: minor changes to doxy sections and naming
Use py_bl_math prefix instead of M_Math.
2020-07-22 15:24:10 +10:00
Cody Winchester
5c28955d3a Modifiers: option to preserve custom normals for subsurf & multires 2020-07-22 15:07:21 +10:00
a197b81090 Docs: include 'bl_math' module 2020-07-22 14:36:30 +10:00
b5194520e3 Fix T79148: UV Edge ring select doesn't select edges
While UV doesn't yet support edge selection, it can
when sync select is enabled.
2020-07-22 14:33:26 +10:00
83cb4f5f8f Cleanup: spelling 2020-07-22 11:57:04 +10:00
7fc9666c89 Cleanup: use elif for sculpt tool checks 2020-07-22 11:29:53 +10:00
59e48d8fe4 Wayland: draw opaque background when OpenGL alpha is enabled 2020-07-22 10:57:42 +10:00
cfa788cf9a GPU: clear color with 1.0 alpha
This impacts GHOST/Wayland which draws windows using alpha.
2020-07-22 10:57:41 +10:00
607d745a79 VR: Change how landmarks affect viewer pose
* Changing to a landmark moves the view exactly to it, rather than
  keeping the current position offset.
* Disabling positional tracking moves the viewer back to the landmark
  position.
This is a more predictable and practical way to use landmarks. See
feedback in T71347.

On the code side, I did some cleanup so the logic flow is more clear.

Note: This is entirely untested. I currently don't have access to a
device. There might be issues, tomorrow I'll hopefully get feedback.
2020-07-22 00:05:56 +02:00
878d191bae Sculpt: Add extra deform types to Slide
This adds extra deform modes to the slide mode of the Topology
Slide/Relax brush (both slide and smear are almost identical).
This is useful to move topology to a specific area to add more localized
details

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D8349
2020-07-21 22:59:07 +02:00
46b126a2c8 UI: Small changes to bevel active tool layout
- Exposes affect enum in the header instead of profile type.
 - Add two missing options from the operator
2020-07-21 16:47:58 -04:00
69afdf6970 Sculpt: Support pen pressure modulation in Paint Brush properties
This allows to use pen pressure modulation in hardness, wet mix, wet
persistence, flow and density, as well as inverting the modulation (more
pressure, less density...). With this, it is possible to create brushes
that mix paint or apply a new color based on the pressure.

Reviewed By: sergey, campbellbarton

Differential Revision: https://developer.blender.org/D8267
2020-07-21 22:43:39 +02:00
4aa2a5481c Bevel: Refactor "Vertex Only" to an enum
This matches the change that was done to the bevel modifier so that the
interface for the modifier, the active tool, and the operator are consistent.

 This commit extends the refactor to the bmesh implementation too, so
that the parameters in the implementation don't stray too far from what
is exposed.

Tests are adjusted and still pass.
2020-07-21 16:32:00 -04:00
a39da2cbca Fix T79056: Topology automasking artifacts in multires
Both to_v and form_v need to be included. From_v is needed to include
the active vertex when there is only one vertex in the radius of the
brush, to_v needs to be included to add all grids duplicates

Reviewed By: sergey

Maniphest Tasks: T79056

Differential Revision: https://developer.blender.org/D8347
2020-07-21 22:27:44 +02:00
7aabd74222 Fix T79007: Smooth brushes crasing in dyntopo
The custom smooth functions for bmesh and meshes where removed and
replaced by a generic smooth function using the sculpt API, which needs
to initialize the bmesh indices in order to be used

Reviewed By: sergey

Maniphest Tasks: T79007

Differential Revision: https://developer.blender.org/D8333
2020-07-21 22:26:42 +02:00
b453e9e3a4 Cleanup: move 'int i' declaration
It is preferable that the value used for interators is defined
close to where it is used.
2020-07-21 14:02:13 -03:00
f8cc01595d Drivers: add lerp and clamp functions to namespace.
Implementation of lerp without a function requires repeating one of
the arguments, which is not ideal. To avoid that, add a new function
to the driver namespace. In addition, provide a function for clamping
between 0 and 1 to support easy clamped lerp, and a smoothstep function
from GLSL that is somewhat related.

The function implementations are added to a new bl_math module.
As an aside, add the round function and two-argument log to the
pylike expression subset.

Differential Revision: https://developer.blender.org/D8205
2020-07-21 19:01:50 +03:00
8369adabc0 Particles: initial object socket and emitter node support
Object sockets work now, but only the new Object Transforms and the
Particle Mesh Emitter node use it. The emitter does not actually
use the mesh surface yet. Instead, new particles are just emitted around
the origin of the object.

Internally, handles to object data blocks are passed around in the network,
instead of raw object pointers. Using handles has a couple of benefits:
* The caller of the function has control over which handles can be resolved
  and therefore limit access to specific data. The set of data blocks that
  is accessed by a node tree should be known statically. This is necessary
  for a proper integration with the dependency graph.
* When the pointer to an object changes (e.g. after restarting Blender),
  all handles are still valid.
* When an object is deleted, the handle is invalidated without causing crashes.
* The handle is just an integer that can be stored per particle and can be cached easily.

The mapping between handles and their corresponding data blocks is
stored in the Simulation data block.
2020-07-21 17:35:09 +02:00
6c7e62ef9b UI: Adjust Multiresolution Modifier Layout
Adjusting the layout for this modifier is the final part of the modifier UI
project for 2.90. This layout exposes the most important information,
the levels and subdivision controls, by default, putting other contols
in collapsed subpanels.

Note that there is empty space for the "Delete Lower" button
that is still planned for 2.90. And there will also eventually be more
items added to the "Shape" panel, maybe for 2.90.

Differential Revision: https://developer.blender.org/D8187
2020-07-21 11:27:05 -04:00
17ebbdf1c1 UI: Use consistent layout for custom operator UI
Operators are one of the last places in Blender to use older UI designs
that don't fit in with recent style conventions. This commit updates
these custom operator UI callbacks for consistency and clarity.

Some of the code is also simplified a lot. Some of the older operator layouts
were much more complex (in terms of code) than they needed to be.

See the differential revision for a before and after screenshot
of each operator.

Differential Revision: https://developer.blender.org/D8326
2020-07-21 11:13:18 -04:00
c2b0c64843 UI: Add an outer boundary for edge panning, use in outliner
Currently if you drag and drop an item from the outliner elsewhere in
the Blender window, the outliner will scroll the entire time, even if the
mouse is far away. This commit adds optional behavior for the edge pan
operator that makes it only act if the mouse is close enough to the region.

Differential Revision: https://developer.blender.org/D8193
2020-07-21 10:12:35 -04:00
696c23f284 Cleanup: Comments. 2020-07-21 16:00:39 +02:00
cd6250c220 Fix (unreported) broken code in recent override operator enhancements.
When overriding a whole linked collection from a single object in
3DView, said 'reference' object would be removed by code. We only want
that behavior when overriding from an instanciating Empty.
2020-07-21 16:00:39 +02:00
d42530824e Fix T78994: Clear selected pose doesn't work without animation
It looks like the code left this as a todo, but the basic solution is to
add an extra parameter to BKE_bose_rest to check whether bones
are selected before reseting them.

I also corrected the operator description which said it acted on only
selected bones even when there is an option to turn that off. The
"act on selected" is generally implied for Blender's operators anyway.

Differential Revision: https://developer.blender.org/D8319
2020-07-21 09:51:27 -04:00
6b6e2e742f Fluid: Updated Mantaflow source files
Updated files include fixes for the mesh IO - read/write success was not propagated.
2020-07-21 15:22:40 +02:00
727e569ac3 Cleanup: CodeQuality: Replace OB_DRAWXRAY by OB_DRAW_IN_FRONT
This is to match the option name and to avoid confusion with
workbench xray mode.
2020-07-21 14:44:37 +02:00
3fe5c0e5df Fluid: Cleanup unused variables 2020-07-21 14:38:26 +02:00
5904953d22 Tests: IO, fixed a memory leak in the USDHierarchyIteratorTest
No functional changes to Blender.
2020-07-21 14:10:42 +02:00
269c184ac9 Cleanup: IO, renamed delete_object_writer()release_writer()
The function is called for all writers, not just 'object' writers.
Furthermore, it's called by the function `release_writers()`, so now the
name is consistent with that as well.

No functional changes.
2020-07-21 14:10:42 +02:00
6b6970d43f Tests: fix link errors when USD and Alembic are disabled
The unit tests for `bf_io_common` didn't actually link against
`bf_io_common`, so when both USD and Alembic were disabled, nothing
would link against that library and building the tests would fail.
2020-07-21 14:10:42 +02:00
bafe22e8ce Fix T79112: Redo shrink/fatten uses negative values
The numbers in the redo panel were negated compared to the value
entered while transforming.
2020-07-21 21:36:10 +10:00
6778ef4dcc Fix T78867: Crash related to viewing video files
Any time FFmpeg was used to get a picture Blender would crash
when FFmpeg 4.3 is used. This affects thumbnails, VSE, Clip Editor.

Caused by a bug in FFmpeg which lead to crashes when unaligned
buffer was passed to sws_scale(). It got fixed later on in FFmpeg,
but for portability and compatibility reasons still nice to avoid
crash, especially since it's not so difficult to do.

FFmpeg ticked number is #8747
The FFmpeg Git hash with the fix: ba3e771a42c2

Differential Revision: https://developer.blender.org/D8355
2020-07-21 12:49:20 +02:00
1c0fa3aff6 GPencil: Reorganize Snap pie menu
Put the options in the same position of meshes.

related to T79094
2020-07-21 12:36:22 +02:00
494a6a0bf2 Cleanup: layer_collection_sync: use LISTBASE_FOREACH_MUTABLE. 2020-07-21 12:18:08 +02:00
629726177a Cleanup: layer_collection_sync: use proper naming.
Previous ones were extremely confusing and innacurate (probably
inherited from older versions of scene collections?).

Also, use named fields in struct initialization, much much safer and
cleaner than anonymous, positionned-based thing.
2020-07-21 12:18:08 +02:00
0bfec04cd5 Fix T72621: Transform object origin support for grease-pencil
Added support for transforming only origins with greasepencil objects.

The new functions is based on BKE_gpencil_transform. That is why there is FIXME statements in there.

Reviewed By: Campbell, Antonio

Differential Revision: http://developer.blender.org/D8303
2020-07-21 12:13:03 +02:00
ece6d8b25a Fix (unreported) bad handling of detection of what to override from 3DView in some cases.
Having a directly linked object does not always mean it should be
considered as really overridable...
2020-07-21 11:59:50 +02:00
b277a75a3b Fix (unreported) LibOverride creation adding things to linked collections.
This is strictly forbidden, and sill cause crashes with undo in some
cases...
2020-07-21 11:59:50 +02:00
8c916a3aec Fix T79066: Entering Edit Mode when Viewport Display set as Wire or Bounds leads to crash 2020-07-21 11:50:21 +02:00
fdc3f56234 Cleanup: convert unsigned to signed comparison in assert
Thanks to Campbell for pointing this out.
2020-07-21 09:03:37 +02:00
c46663ad66 Cleanup: spelling 2020-07-21 16:02:58 +10:00
b31d3d1202 Fix UV edge/face sync selection from recent sticky select cleanup 2020-07-21 15:46:14 +10:00
2bc1fd7e91 Cleanup: simplify sticky UV selection
Use BMesh connectivity information instead of looping over all
geometry to flush the sticky selection.
2020-07-21 14:54:41 +10:00
b88dd3b8e7 UV: remove selection threshold for nearby coordinates
Internally UV selection considered close UV's to be connected.
While this could be convenient in some cases,
it complicates logic for more advanced selection operations that
need to check when UV's should be considered part of the same vertex
since simple threshold checks would give different results depending
on the order of UV's tested.

Users must now run "Merge by Distance" instead of relying
on this selection threshold.
2020-07-21 14:32:21 +10:00
50fe187443 Cleanup: improve comment for disabled readfile allocation naming
Also allocate the required amount instead of a fixed size.
2020-07-21 12:25:20 +10:00
731d9f0bfa Fix T78733 Bevel sometimes produces zero-area UV face with odd segments.
A bug introduced when I made the choice of interpolation face cleverer.
2020-07-20 16:08:43 -04:00
ed870f87b9 Fix weird placement of "Motion Tracking" in 3D View overlay popup
There was a weird looking gap between the checkbox and the "Motion Tracking"
label. Plus, the label could not be clicked to change the value, unlike
usually.

Issue is that the row is actually a sub-panel header. The checkbox being drawn
with the draw_header() callback, and the label being added as separate item by
the popover panel code. This adds a hack so the checkbox can add the panel
label itself (the popup drawing skips adding the label then). That addresses
mentioned issues.
2020-07-20 19:54:43 +02:00
d40c39fca0 Cycles: adjust Sky texture intensity to follow physical units
The sky will appear brighter than before by default. To compensate for this,
lower exposure in the Film panel. The default altitude was also changed from
90 to 15 degrees.

Patch contributed by Marco with the help of Ryan Jones.

Differential Revision: https://developer.blender.org/D8285
2020-07-20 19:31:42 +02:00
Miguel Pozo
52543be9a6 Python API: option to use OpenGL context in RenderEngine.render
When bl_use_gpu_context is set, an OpenGL context will be available for
OpenGL based render engines.

Differential Revision: https://developer.blender.org/D8305
2020-07-20 19:31:42 +02:00
a9644c812f Cycles: Use pre-compiled PTX kernel for older generation when no matching one is found
This patch changes the discovery of pre-compiled kernels, to look for any PTX, even if
it does not match the current architecture version exactly. It works because the driver can
JIT-compile PTX generated for architectures less than or equal to the current one.
This e.g. makes it possible to render on a new GPU architecture even if no pre-compiled
binary kernel was distributed for it as part of the Blender installation.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D8332
2020-07-20 19:25:27 +02:00
a5ded0720c Fix (unreported) broken deletion of Shapekeys alongside their owner ID.
Trying to get shape key pointer after having unlinked its owner from
Main data-base is rather useless... So those shapekeys ended up never
being deleted.
2020-07-20 19:18:45 +02:00
bb63ce9839 Fix (unreported) bad handling of shapekeys when applying override rules.
We need to do a full proper swap of those shape keys as well, previous
code ended up breaking relationships between data-blocks...
2020-07-20 19:18:45 +02:00
62a819202e Fluid: Refactored smoke noise system
This refactor is in response to reports in which the adaptive domain with noise caused a crash (e.g. T79009). It should also fix issues where the smoke appeared to be cut off when using the adaptive domain together with noise. It is also possible that some of these changes improve the lines issue from T74559.
2020-07-20 18:35:52 +02:00
Adrian Newton
7d85495ab9 UI: Fix File Broswer filter checkbox not connected to label
Differential Revision: https://developer.blender.org/D8168

Reviewed by: Hans Goudey, Julian Eisel
2020-07-20 17:36:43 +02:00
4432209849 Fix T78321 Eevee: Motion blur crash rendering animation with high steps count
This was caused by `BPy_*_ALLOW_THREADS` being used when it shouldn't.

Implemented the simple fix suggested by @brecht :

> The simplest solution may be to ensure that Python stuff is only done
> when called through the RNA API, and not when Eevee calls it directly.
2020-07-20 17:23:28 +02:00
7484e45297 Fix T78960: 2.83.2 not opening a 2.82a project correctly.
That project cannot be opened correctly ayway, it has recursive
collections intanciating themselves...

But at least now we have a check at startup to detect and 'fix' those
nasty cycles in collections.
2020-07-20 17:04:16 +02:00
ccc2a7996b BLI: add typedefs for containers that use raw allocators
Those are useful when you have to create containers with static
storage duration. If those would use Blender's guarded allocator,
it would report memory leaks, that are not actually leaks.
2020-07-20 16:03:14 +02:00
ed184050b6 Fix T78958: Library Override crash: undo make local. 2020-07-20 15:36:31 +02:00
4f4af0cbe1 Particles: support removing particles during the simulation
This still cannot be controlled by the user. Currently, all particles are
killed after two seconds
2020-07-20 15:31:05 +02:00
9016a29f19 Fix T79107: Crash changing brush size in GPencil sculpt
Reviewed By: fclem

Maniphest Tasks: T79107

Differential Revision: https://developer.blender.org/D8353
2020-07-20 15:23:00 +02:00
230f7d79ce Fix signed/unsigned comparison 2020-07-20 14:04:09 +02:00
cbf2278266 Fix T79075: Tool popup fails with experimental vertex colors enabled
Register key-maps from tools in functions.
2020-07-20 21:55:48 +10:00
ac5f011e9c Fix T70455: Knife Tool failing to cut edges
Analyzing the cuts, the points shown in the viewport (indicating the
previous and current cuts) do not correspond to the final cuts.

Sometimes a point, even snapped to a vert, is a point that cuts an edge and
sometimes a point, even snapped to an edge, is a point that cuts only the face.

This is because the detection of snapping vertices from mouse is different
from the "snap" that detects vertices that are cut.

So small projection inaccuracies can result in detection failures.

The solution for this is simply to confirm the cuts whose vertices
indicate the `prev` ou and `cur` point.

The tolerance distance does not need to be calculated in these cases.
2020-07-20 08:52:11 -03:00
33ad95b677 Animation: Fix MSVC warning about C incompatibility of AnimationEvalContext
Thanks @JacquesLucke for pointing this out.

No functional changes.
2020-07-20 13:14:00 +02:00
579b180053 BLI: add Vector/Array.fill methods 2020-07-20 13:02:10 +02:00
8cbbdedaf4 Refactor: Update integer type usage
This updates the usage of integer types in code I wrote according to our new style guides.

Major changes:
* Use signed instead of unsigned integers in many places.
* C++ containers in blenlib use `int64_t` for size and indices now (instead of `uint`).
* Hash values for C++ containers are 64 bit wide now (instead of 32 bit).

I do hope that I broke no builds, but it is quite likely that some compiler reports
slightly different errors. Please let me know when there are any errors. If the fix
is small, feel free to commit it yourself.
I compiled successfully on linux with gcc and on windows.
2020-07-20 12:16:20 +02:00
Sybren A. Stüvel
686ab4c940 T77086 Animation: Passing Dependency Graph to Drivers
Custom driver functions need access to the dependency graph that is
triggering the evaluation of the driver. This patch passes the
dependency graph pointer through all the animation-related calls.

Instead of passing the evaluation time to functions, the code now passes
an `AnimationEvalContext` pointer:

```
typedef struct AnimationEvalContext {
  struct Depsgraph *const depsgraph;
  const float eval_time;
} AnimationEvalContext;
```

These structs are read-only, meaning that the code cannot change the
evaluation time. Note that the `depsgraph` pointer itself is const, but
it points to a non-const depsgraph.

FCurves and Drivers can be evaluated at a different time than the
current scene time, for example when evaluating NLA strips. This means
that, even though the current time is stored in the dependency graph, we
need an explicit evaluation time.

There are two functions that allow creation of `AnimationEvalContext`
objects:

- `BKE_animsys_eval_context_construct(Depsgraph *depsgraph, float
  eval_time)`, which creates a new context object from scratch, and
- `BKE_animsys_eval_context_construct_at(AnimationEvalContext
  *anim_eval_context, float eval_time)`, which can be used to create a
  `AnimationEvalContext` with the same depsgraph, but at a different
  time. This makes it possible to later add fields without changing any
  of the code that just want to change the eval time.

This also provides a fix for T75553, although it does require a change
to the custom driver function. The driver should call
`custom_function(depsgraph)`, and the function should use that depsgraph
instead of information from `bpy.context`.

Reviewed By: brecht, sergey

Differential Revision: https://developer.blender.org/D8047
2020-07-20 11:51:09 +02:00
6fbfa522e6 GPencil: Fix unreported wrong SNAP menu in Point Context menu
It was using the mesh menu instead of GPencil one.
2020-07-20 11:10:47 +02:00
e4daac84b6 Fix T79094: GPencil Snap menu with Shift+S not pie menu
In order to keep UI consistency, now it's a pie menu.
2020-07-20 11:07:28 +02:00
eb5cd628bd Fix T79089: Crash changing themes
Regression from 2840782d84.
2020-07-20 17:52:58 +10:00
b219ae4498 Fix T79077: Off-screen rendering ignores shading argument
Thumbnails used the 3D view shading mode when a camera wasn't used.
2020-07-20 11:32:26 +10:00
615af4e239 DRW: draw hook relationship lines
This wasn't added back from 2.7x, making "Recenter Hook" applier to
do nothing.
2020-07-20 09:25:26 +10:00
9db4e44961 DRW: overlay engine support for drawing isolated points
This matches similar functionality for drawing lines.
2020-07-20 09:19:50 +10:00
Yevgeny Makarov
78e40ad21f UI: use "Recalculate" instead of "Recalc" 2020-07-20 07:23:16 +10:00
6247ec7827 Fix T78977 GPU: blf fonts are not gamma corrected 2020-07-19 23:00:22 +02:00
3884d78e49 Particles: Make it easier to add attributes internally 2020-07-19 22:06:35 +02:00
5063820c9b Particles: Emit particles over time
This adds a basic internal emitter for every particle simulation.
The emitter cannot be controlled by the user yet. That will
come next.
2020-07-19 13:58:58 +02:00
8c90910dcc Fix T66937: Blank view on navigation with auto-deph & large clip-end 2020-07-19 21:27:13 +10:00
ccd2af43b3 Fix T78624: Crash running operators from Python in background mode 2020-07-19 18:59:14 +10:00
52a7c724b5 Cleanup: unused argument warning 2020-07-19 17:43:59 +10:00
71d0f6f896 Cleanup: spelling 2020-07-19 17:37:02 +10:00
b8601b64c7 Correct Blender version after last commit
c08d847488 incremented the patch version instead of the file subversion
for versioning code when adding new options. This commit resets the patch
version and instead bumps the file subversion.
2020-07-18 12:26:32 -04:00
c08d847488 UI: Status Bar Statistics and Other Options
Status Bar can show scene statistics, memory usage, version, etc set by context menu. Part two of T75672.

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

Reviewed by Julian Eisel
2020-07-18 07:49:25 -07:00
fe49e4139c Simulation: cleanup deduplicating attribute input nodes 2020-07-18 10:51:38 +02:00
9eaa48f520 Simulation: cleanup how data inputs are handled 2020-07-18 10:19:26 +02:00
fd67b521b9 Simulation: deduplicate code that finds particle simulation names 2020-07-18 10:08:53 +02:00
63db971a00 Simulation: fix memory leak 2020-07-18 10:06:36 +02:00
1dd381828f UV: edge-ring selection support
Matches edit-mesh edge-ring selection.
2020-07-18 16:09:17 +10:00
c48ccb38cb BMesh: utility for checking shared edge with limit argument 2020-07-18 15:54:04 +10:00
4e73ba2cab Cleanup: split UV loop select out of mouse picking function 2020-07-18 15:43:37 +10:00
f24ccedc18 UV: utility functions for sticky select setting
Support setting vert/edge/face selection, using the sticky option
without performing a second loop over all faces to flush selection.

Existing selection code didn't take advantage of BMesh connectivity
since the logic is from before BMesh was included.
2020-07-18 15:37:33 +10:00
016253a648 Cleanup: spelling 2020-07-18 14:27:53 +10:00
fd08d6f391 Cleanup: unused warning 2020-07-18 14:27:30 +10:00
d99b343b31 Cleanup: UV selection
Remove commented code, move penalty calculation into own function.
2020-07-18 14:15:02 +10:00
d9228c557b Cleanup: KnifeTool: Replace glPolygonOffset by GPU_polygon_offset 2020-07-18 03:46:12 +02:00
4c28b1c74e Cleanup: GPU: Encapsulate clipDistances
This also remove some non functionnal state changes that were left
from legacy code.
2020-07-18 03:43:52 +02:00
59975b0adf Cleanup: WM: Encapsulate stereo draw buffers binding 2020-07-18 03:43:52 +02:00
8dfc31f61f Cleanup: GPU: Encapsulate glProvokingVertex 2020-07-18 03:43:52 +02:00
264b1e1e15 Cleanup: GPU: Encapsulate glFrontFace 2020-07-18 03:43:52 +02:00
5993c53a6d Cleanup: GPU: Encapsulate Backface culling 2020-07-18 03:43:52 +02:00
c14e6cdd56 Cleanup: View3D: Encapsulate OpenGL calls
Removes GL_DEPTH_RANGE query as it is not changed anywhere.
2020-07-18 03:43:52 +02:00
1f2edba1fb Cleanup: GPU: Encapsulate scissor test 2020-07-18 03:43:52 +02:00
d19b3019d9 Cleanup: GPU: Encapsulate glScissor 2020-07-18 03:43:52 +02:00
a6bd7777c2 Cleanup: GPU: Encapsulate glViewport calls 2020-07-18 03:43:52 +02:00
35f1b3e43b Cleanup: GPU: Wrap GL_UNPACK_ROW_LENGTH in GPU_state
Also go back to default value of 0 after usage.
2020-07-18 03:43:52 +02:00
faeaf53255 Cleanup: Sequencer: Use GPUTexture instead of opengl calls 2020-07-18 03:43:52 +02:00
e2305690eb Cleanup: WM: Use GPUTexture for radial control drawing 2020-07-18 03:43:52 +02:00
2d9eee15c5 Cleanup: GPU: Set default GL_UNPACK_ALIGNMENT to 1
Ogl default is 4 but for almost all cases, blender use tightly
packed format. This avoid confusion and state change for the
common case.

The only case that __might__ need alignement is DDS loader
(untested) so leaving this as it is.
2020-07-18 03:43:52 +02:00
0ef57d3fc0 Cleanup: glutil: Use GPUTexture in immDrawPixelsTexScaled_clipping
This also cleanup the code for readability.
2020-07-18 03:43:51 +02:00
122d0c8f4b Cleanup: ClipDraw: Use GPUTexture api and fix a vmem leak
Leak was silent as it was an opengl handle.
2020-07-18 03:43:51 +02:00
dcf6e12a60 Cleanup: GPUShader: Remove unused builtin shader 2020-07-18 03:43:51 +02:00
7e66616b7e Cleanup: ClipDraw: Remove usage of GPU_SHADER_3D_IMAGE_MODULATE_ALPHA 2020-07-18 03:43:51 +02:00
6d160f199c Cleanup: PaintCursor: Use GPUTexture instead of opengl calls 2020-07-18 03:43:51 +02:00
99b424334d GPU: Add immBindTexture and immBindTextureSampler 2020-07-18 03:43:51 +02:00
5b4a862f83 GPUTexture: Add better swizzle support 2020-07-18 03:43:51 +02:00
2840782d84 Cleanup: GPU: Make icon drawing use GPUTexture
This remove all gl function calls. Adds a new sampler only
for icon drawing.
2020-07-18 03:43:51 +02:00
02c09773ea Cleanup: GPU: rename bglPolygonOffset to GPU_polygon_offset
And move it to GPU module.
2020-07-18 03:43:51 +02:00
acad0d75b1 Cleanup: GPU: Replace glBlendFunc by GPU equivalent 2020-07-18 03:43:51 +02:00
3d536f69f6 UI: Use property split for custom property edit popover
The panel looks out of place with the rest of Blender's UI and the
text is cropped. With property split turned on and a few smaller
tweaks these issues are fixed.

|  Before  |  After   |
|{F8700181}|{F8700183}|

Differential Revision: https://developer.blender.org/D8322
2020-07-17 19:54:11 -04:00
aa8279648e Simulation: extract node tree parsing code to separate file 2020-07-17 21:20:51 +02:00
25582aef61 Simulation: separate code from node tree parsing and solver 2020-07-17 21:20:51 +02:00
69d14c0ddb Fix T78959: Show current frame indicator when interface is locked
When the playhead drawing moved to an overlay, a check was added to keep
it from drawing with a locked interface. This is necessary for some overlays,
but not this one, so this removes the check, making it the responsibility of
the editor.

A context function is added to make that check easier in the future.

Differential Revision: https://developer.blender.org/D8313
2020-07-17 15:18:54 -04:00
8b0df381d9 Transform: use GHASH_ITER when restoring customdata 2020-07-17 14:33:40 -03:00
d8a6eec1a3 Cleanup: Removed incorrect // namespace DEG comment
No functional changes.
2020-07-17 16:49:00 +02:00
893eb30730 Fluid: Numpy support for Mantaflow build system
Adjusted the fluid build system so that plugins that depend on numpy can be compiled as well.

Note that in this commit numpy support is still disabled. It can be enabled by re-running the Mantaflow update script with USE_NUMPY=1 and enabling WITH_MANTA_NUMPY in extern/mantaflow/CMakeLists.txt. This will happen in a future commit.
2020-07-17 16:11:21 +02:00
0cdc75ccd2 Fluid: Cleanup build system for extern mantaflow
No longer including unused dependencies. Should numpy IO be needed at some point, the Manta source update script can be configured so that the required dependencies are included again.
2020-07-17 15:58:13 +02:00
e3f8768d8a Refactor: move ParticleFunction to separate file 2020-07-17 14:23:57 +02:00
2679236047 Cleanup: avoid static initialization order issues when accessing CPPTypes
Instead of depending on static initialization order of globals use
static variables within functions. Those are initialized on first use.
This is every so slighly less efficient, but avoids a full class of problems.
2020-07-17 14:15:06 +02:00
3ef59121a4 Simulation: move initial simulation code from bf_blenkernel to bf_simulation
I removed bf_blenkernel from `nodes/CMakeLists.txt` again (added it yesterday),
because now this was causing me unresolved symbol errors... Without it, cmake
seems to link the libraries bf_simulation, bf_blenkernel and bf_nodes in the right
order. Not sure if that is just luck or if it is guaranteed.

It was possible to fix the issue by using cmakes `LINK_INTERFACE_MULTIPLICITY`,
but that is probably bad style.
2020-07-17 13:49:18 +02:00
Jeroen Bakker
9582797d4b Fix T77867: Link Duplicate Object crashes during batch creation
When using link duplicated objects it could happen that one object is
calculating the GPUBuffers and the second object is marking these
buffers invalid. This introduces threading issues.

This patch fixes this by combining the surface and surface per material
batches. Most likely the surface per material batches are used and when
requested you will most likely need the surface batch for the depth
tests and overlays.

During tests it slightly improves performance as batches aren't thrown
away without using it.

After this patch we can add a quick path for meshes with one material
and two materials.

Alternative approaches that have been checked:
- sync extraction per object: reduced performance to much (-15%)
  ({D8292})
- post checks: reduced the threading issues, but didn't solve it.
- separating preparation and execution of the extraction ({D8312})

Reviewed By: Clément Foucault

Differential Revision: https://developer.blender.org/D8329
2020-07-17 13:47:53 +02:00
bf2bb6db26 Cleanup: silence unused variable warning
Reviewed By: fclem

Differential Revision: https://developer.blender.org/D8328
2020-07-17 17:12:46 +05:30
0e3d34e48f BLI: add StringRefNull.c_str() method
This should be used whenever you rely on the fact, that the
returned pointer points to the beginning of a null-terminated array.
2020-07-17 12:38:15 +02:00
0fcd23a388 Simulation: use better api for adding and removing simulation states 2020-07-17 12:36:23 +02:00
c5f61fbf48 Cleanup: avoid warning about redundant access specifier
No functional changes.
2020-07-17 11:49:51 +02:00
5910dbdbf7 Nodes: move some code from blenkernel directory to nodes
This also introduces the `blender::nodes` namespace. Eventually,
we want to move most/all of the node implementation files into
this namespace.

The reason for this file-move is that the code fits much better
into the `nodes` directory than in the `blenkernel` directory.
2020-07-17 11:36:59 +02:00
0a40c671b0 Cleanup: consistent ordering for scene argument to UV functions 2020-07-17 17:39:47 +10:00
83e204702d Cleanup: remove f-string use in favor of percentage for formatting 2020-07-17 17:39:47 +10:00
618f31312c Fix vertex selection error from recent refactor
Temporary fix for regression in 8084b7e6e2.
2020-07-17 17:37:35 +10:00
89a7a1c156 Cleanup: extract draw cache sanity checks to own function 2020-07-17 08:31:03 +02:00
608d9b5aa1 UI: Add shortcuts for constraint panels
Only the delete shortcut applies here, although the move up and down
operators can optionally be assigned in the keymap.

See rB1fa40c9f8a81 for more details and rB5d2005cbb54b for the
grease pencil modifier panel implementation, which is the same.
Some refactoring of the constraint delete operator was necessary,
including adding an invoke function.

Differential Revision: https://developer.blender.org/D8238
2020-07-16 14:07:47 -04:00
b13bbb22e4 Fix link error in bf_nodes
I got undefined reference errors on the `NodeMFNetworkBuilder::get_default_fn`
function under some circumstances. This symbol is definitely defined in bf_blenkernel.
The error seemed a bit undeterministic and was probably caused by some incorrect
link order. I don't get the error with this change.
2020-07-16 19:52:28 +02:00
02a3720000 Simulation: rename bf_physics to bf_simulation
Also see {rB9363c4de0635394548fa2eb8d205581313029775}.
2020-07-16 18:49:59 +02:00
93f21ebb13 Fluid: Update Mantaflow source files
Includes cleanup that resolves a -Wunused-but-set-variable warning.
2020-07-16 18:04:44 +02:00
e7c1a32a78 Tests: disable ASAN when discovering tests
CMake, when it's configuring the project, runs the `blender_test` test
runner (if it exists from a previous build) to discover which tests it
contains. At this time none of the tests themselves are run, so it's not
that useful to run ASAN and have it break things when there are memory
leaks.

This commit disables ASAN by injecting `ASAN_OPTIONS="detect_leaks=0"` in
the environment variables.

It is not enough to use `set(ENV{ASAN_OPTIONS} "detect_leaks=0")` in
`tests/gtests/runner/CMakeLists.txt`, as it wouldn't be passed to the child
process.
2020-07-16 17:38:29 +02:00
a138bf57c9 Tests: move tests from USD test directory into io/common and io/usd
This commit is a followup of {D7649}, and ports the USD tests to the new
testing approach. It moves test code from `tests/gtests/usd` into
`source/blender/io/common` and `source/blender/io/usd`, and adjusts the
use of namespaces to be consistent with the other tests.

I decided to put one test into `io/usd/tests`, instead of
`io/usd/intern`. The reason is that this test does not correspond with a
single file in that directory; instead, it tests Blender's integration
with the USD library itself.

There are two new CLI arguments for the Big Test Runner:

- `--test-assets-dir`, which points to the `lib/tests` directory in the
  SVN repository. This allows unit tests to find test assets.
- `--test-release-dir`, which points to `bin/{BLENDER_VERSION}` in the
  build directory. At the moment this is only used by the USD test.

The CLI arguments are automatically passed to the Big Test Runner when
using `ctest`. When manually running the tests, the arguments are only
required when there is a test run that needs them.

For more info about splitting some code into 'common', see
rB084c5d6c7e2cf8.

No functional changes to the tests themselves, only to the way they are
built & run.

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

Reviewed by: brecht, mont29
2020-07-16 17:38:29 +02:00
Francesco Siddi
09a483a3aa macOS: improve design of .dmg background
Differential Revision: https://developer.blender.org/D8300
2020-07-16 17:28:27 +02:00
671c6d8afd Cleanup: Gizmo: Remove non matched glDisable
We use the polyline shader for drawing the rotation gizmo now.
This shader supports clipping without hardware clip planes.
2020-07-16 18:01:44 +02:00
07d70a76df Cleanup: WM: Use GPUTexture API instead of raw ogl calls 2020-07-16 18:01:44 +02:00
5099cbeec9 Cleanup: GPU: Move depth/color masks functions to GPU_state 2020-07-16 18:01:44 +02:00
436d38bb54 Cleanup: GPU: Move XOR logic op to gpu_state.c 2020-07-16 18:01:44 +02:00
3481f6eaf2 Cleanup: GPU: Remove GL_DITHER usage 2020-07-16 18:01:44 +02:00
71ac137662 Cleanup: GPU: Move quad buffer stereo check to GPU module 2020-07-16 18:01:44 +02:00
8084b7e6e2 Cleanup: GPU: Replace all glReadPixels by GPU equivalent 2020-07-16 18:01:44 +02:00
ab19abe223 Cleanup: Port glClear calls to GPU module functions 2020-07-16 18:01:44 +02:00
bc85081156 Cleanup: DRW: remove uneeded double bind
Now that binds are permanent there is no need to setup the same
texture for each subgroups.
2020-07-16 18:01:44 +02:00
56b8adb9e2 Particles: avoid crash when connected unimplemented node 2020-07-16 16:43:42 +02:00
1494ad20b9 Particles: add implicit covnersions between Vector and Color
Not sure if these conversions are a good idea. However, we have them
in Cycles, so they be available in the simulation node tree for consistency
reasons.
2020-07-16 16:43:42 +02:00
76bf050853 Particles: simplify adding new implicit conversions between sockets 2020-07-16 16:43:42 +02:00
aa547ce88b Fluid: Update Mantaflow source files
Refactored various functions after noticing new warnings when compiling on Apple DTK devices - there should now be fewer warnings when building.
2020-07-16 16:39:49 +02:00
f64710a518 Particles: change initial velocity of particles
This is only temporary, but makes testing the system a bit easier.
2020-07-16 16:09:19 +02:00
4249d6f58e Particles: support Separate/Combine RGB nodes 2020-07-16 16:09:19 +02:00
ada173ebfd Particles: simplify Combine XYZ node 2020-07-16 16:09:19 +02:00
72df7c23c4 Particles: support Color Ramp node 2020-07-16 16:09:19 +02:00
c7aa0f9d74 Fix T78537: too much memory usage rendering animation with persistent images
For still images, always return 0 for the current frame number. This ensures
Cycles can detects that the image did not change.

Based on patch by Vincent Blankfield.

Differential Revision: https://developer.blender.org/D8242
2020-07-16 15:50:43 +02:00
279cc34343 Keymap: disable 'Alt' click for tools prompt by default
Based on feedback from artists in the Blender Studio this is too
easy to access by accident.

This is still accessible as a preference.
2020-07-16 23:48:38 +10:00
83955d6769 Particles: support Map Range node
Only linear interpolation mode is supported for now.
2020-07-16 13:26:20 +02:00
99fda4d31e deps builder: Fix typo in windows harvesting 2020-07-16 07:22:52 -06:00
9b6088cb9d Simulation: Change BPH prefix to SIM
In a previous commit the `physics` folder has been renamed to `simulation`.
This commit updates the function/file prefix accordingly.
2020-07-16 14:37:21 +02:00
9363c4de06 Simulation: Rename physics directory to simulation
Function names will be updated in a separate commit.

This will be the place for the new particle system and other
code related to the Simulation data block. We don't want
to have all that code in blenkernel.

Approved by brecht.
2020-07-16 14:28:38 +02:00
66b48ad8fb Fix git tag warning when running make update after recent changes 2020-07-16 14:26:37 +02:00
f3ea6a5b28 Particles: implement more vector math operations 2020-07-16 14:15:24 +02:00
3d8f8085fb UI: show connected icon for proportional editing in the image space 2020-07-16 22:07:53 +10:00
b882f89fe3 Particles: support for most math node operations 2020-07-16 13:41:47 +02:00
2ddb3dc617 Nodes: support default function for partially implemented nodes 2020-07-16 13:38:23 +02:00
56aa5b0d8c T73268: Link C/C++ unit tests into single executable
This commit introduces a new way to build unit tests. It is now possible
for each module to generate its own test library. The tests in these
libraries are then bundled into a single executable.

The test executable can be run with `ctest`. Even though the tests
reside in a single executable, they are still exposed as individual
tests to `ctest`, and thus can be selected via its `-R` argument.

Not yet ported tests still build & run as before.

The following rules apply:

- Test code should reside in the same directory as the code under test.
- Tests that target functionality in `somefile.{c,cc}` should reside in
  `somefile_test.cc`.
- The namespace for tests is the `tests` sub-namespace of the code under
  test. For example, tests for `blender::bke` should be in
  `blender::bke:tests`.
- The test files should be listed in the module's `CMakeLists.txt` in a
  `blender_add_test_lib()` call. See the `blenkernel` module for an
  example.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D7649
2020-07-16 12:58:49 +02:00
065a00ee3e Fix T78920: missing depsgraph relation when using sound strips in VSE
Having a sound strip in the VSE caused a missing relation error to be
logged on the console. This was caused by the AUDIO depsgraph component
not having an entry node. This commits adds that node, and sets up
relations correctly.

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

Reviewed By: Sergey
2020-07-16 11:51:39 +02:00
d4ce777aed BLI: move inline include to the bottom to avoid redeclaration warning 2020-07-16 11:33:35 +02:00
d897228682 BLI: move safe math functions to separate header 2020-07-16 11:28:31 +02:00
f6f93b5b12 BLI: add safe_divide, safe_modf and safe_logf
Those are defined exactly as their corresponding functions in Cycles.
2020-07-16 11:05:30 +02:00
7e0bf7a0f1 LibOverride: Fix getting proper RNA path and ID from embedded ones.
Master collections and root node trees should now be working as expected
in that regard.
2020-07-16 11:04:03 +02:00
35bfe1702c BLI: add safe_powf function
The same function is also used by cycles.
2020-07-16 10:46:18 +02:00
Yevgeny Makarov
4a9d903e2b Fix View3D "Mirror" menu, both "Global" and "Local" items are GLOBAL 2020-07-16 18:08:25 +10:00
Stefan Werner
9715ad5aca macOS: Support arm64 architecture.
Enabling all `make deps` dependencies with the exception of Embree and OIDN.
After that, Blender can be compiled on an Apple Silicon Mac just like on any
Intel based Mac. There are still compiler warnings that need to be
investigated and there are probably a couple of bug still to be discovered
and to be fixed.

Most patches to the dependencies are simple and are about disabling SSE and
setting the proper architecture to compiile for. Notable exception is Python,
where I back ported a yet to be accepted PR for upstream Python:
https://github.com/python/cpython/pull/21249

Cross compiling or buliding a Universal Binary is not supported yet.
The minimum macOS target version for x86_64 remains at 10.13, the target
for arm64 is 11.00.

Differential Revision: https://developer.blender.org/D8236
2020-07-16 09:37:38 +02:00
ad4928a171 UI: avoid aligning labels for ui_item_with_label
Key-map display was doing thousands of redundant alignment operations.
Set the spacing instead as align was only set to use zero spacing.

This would have prevented the crash reported by T78636.
2020-07-16 17:00:16 +10:00
75520894c7 Fix T78636: Crash displaying many aligned buttons
Displaying user preferences search crashed on macOS when the search
contained a common character such as 'E'.
This caused alignment to 'alloca' too much memory.

Replace with a heap allocation fallback.
2020-07-16 16:38:07 +10:00
2811de6e5c Cleanup: fix building without USE_UIBUT_SPATIAL_ALIGN defined 2020-07-16 13:48:01 +10:00
5b099a25d7 Fix T78966: Center cursor doesn't refresh the UI 2020-07-16 13:27:50 +10:00
123e29c274 Cleanup: missing CMake headers from source lists 2020-07-16 13:17:31 +10:00
54abab53bf Cleanup: undeclared function warning, unused argument 2020-07-16 11:14:27 +10:00
a3d90337b8 Cleanup: spelling 2020-07-16 11:09:39 +10:00
d11a2dfe71 Cleanup: minor change to grease pencil material access
Rename for clarity and avoid passing in the prefix length.
2020-07-16 11:09:39 +10:00
75a09ba2ed Fix T78837: Prefetching can corrupt .blend files
This happened because of typo in seq_dupli() when duplicating effect data.
Instead of duplicating data to new sequence, it was duplicated into original.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D8295
2020-07-16 02:24:37 +02:00
974e36d7d0 Fix T78647 UVEdit: Crash when entering edit mode with UV Editor open
Only affects MacOS.
2020-07-15 21:14:46 +02:00
058514aa0a PointCloud: Initial rendering support for Workbench
Also includes outline overlays. Removes the temp overlay drawing

We make the geometry follow camera like billboards this uses less
geometry. Currently we use half octahedron for now. Goal would be
to use icospheres.

This patch also optimize the case when pointcloud has uniform radius.
However we should premultiply the radius prop by the default radius
beforehand to avoid a multiplication on CPU.

Using geometry instead of pseudo raytraced spheres is more scalable as
we can render as low as 1 or 2 triangle to a full half sphere and can
integrate easily in the render pipeline using a low amount of code.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D8301
2020-07-15 20:10:45 +02:00
d4d810f817 Cleanup: EEVEE: Remove concentric samples. 2020-07-15 19:51:55 +02:00
37a8c6d809 Cleanup: EEVEE: Remove unused IRRADIANCE_CUBEMAP 2020-07-15 19:51:55 +02:00
47885abbe6 Workbench: Replace viewvecs caculation by DRWView 2020-07-15 19:51:55 +02:00
cd8f3c9ee7 DRW: Add glsl math libraries
Copied from eevee bsdf_common_lib.glsl
2020-07-15 19:51:55 +02:00
2c1edcf3ef EEVEE: Fix undefined behavior in world output 2020-07-15 19:51:55 +02:00
24c846b2b4 GPU: Shader: Move IN_OUT define to shader GPU_shader_create_ex
This adds the opportunity to use it in multiple places.
2020-07-15 19:51:55 +02:00
987d14a3b2 DRW: Shader: Fix const correctness and print better debug output 2020-07-15 19:51:55 +02:00
8e16873086 DRW: Shader: Add DRW_shader_create(_fullscreen)_with_shaderlib
Some convenience function for using DRWShaderLibrary.
2020-07-15 19:51:55 +02:00
5dcf60e053 DRW: View: Add ViewVecs calculation
This will remove some code duplication between draw engines.
2020-07-15 19:51:55 +02:00
f1104c2828 Fix T78369: Sculpt Vertex Colors not rendering in EEVEE
The vertex colors node was using the M_COL attribute type but Sculpt
Vertex Colors use CD_PROP_COLOR
Now the Vertex Color node also fallbacks to legacy vertex colors if
Scultp Vertex Colors are not enabled as experimental.

Reviewed By: brecht

Maniphest Tasks: T78369

Differential Revision: https://developer.blender.org/D8185
2020-07-15 18:55:33 +02:00
eb54624a9a LibOverride: make outliner's 'override hierarchy' use same logic as 3DView operator.
So now one can create a 'full', 'complete' override of a character from
the outliner as well.
2020-07-15 18:17:34 +02:00
5057b28a2f LibOverride: move most of 'complete override creation' from ED_object to BKE_lib_override.
This code is fairly complex and can be used in more places, better not
duplicate that logic and just have it in BKE area.
2020-07-15 18:17:34 +02:00
ba100c883c BKE collection: add util to add a collection using another collection as 'template'.
Similar to what we already had using an object as 'template'.
2020-07-15 18:17:34 +02:00
a082e49671 Cleanup: remove debug prints. 2020-07-15 18:17:34 +02:00
cda6da4957 Fix error in recent commit
Obviously a copy paste error of mine...
2020-07-15 18:14:03 +02:00
ae4098e234 GPencil: Fix unreported error baking mesh animation
When the mesh is linked, the materials can not be available or be the same assigned to mesh. Now, if the mesh is linked, a simple two materials conversion is used.

To get the full list of materials, the mesh must not be linked.

Also checked some indexes to be sure never get a wrong value and that materials are not created again and again.
2020-07-15 17:26:27 +02:00
36e836d0e9 Fluid: Adjusted Mantaflow version number
Version number was increased after recent OpenVDB IO changes.
2020-07-15 17:04:56 +02:00
19d17b217a Particles: use CD_PROP_FLOAT3 instead of CD_LOCATION
`CD_LOCATION` was only used temporarily due to the lack
of a better alternative. This also removes the name from
`CD_LOCATION` again, because at most one layer of this
type should exist.
2020-07-15 16:48:30 +02:00
57ec1f37e9 CustomData: add float2 and float3 data types
This adds `CD_PROP_FLOAT2` and `CD_PROP_FLOAT3`.

Reviewers: brecht

Differential Revision: https://developer.blender.org/D8251
2020-07-15 16:42:17 +02:00
e06a346458 Fix T78747: Fix mesh boundary detection and automasking
This issue was produced by a hack in the sculpt mode code from 2.80
 when the sculpt API for connectivity info was not available.
The smooth brush was the only brush that needed connectivity info,
so there were 3 different smooth functions with the connectivity
queries implemented for dyntopo, meshes and grids. The mesh version
of smoothing was checking the number of connected faces to a vertex
to mask the mesh boundaries, which was not covering all cases and
was hardcoded in the smooth function itself.

This patch removes all those legacy functions and unifies all
smooth functions into a single one using the new API and the
automasking system. In order to achieve this, there were needed
some extra changes:

- The smooth brush now does not automasks the boundaries by default,
so its default preset needs to be updated to enable automasking

- The mesh boundary info is extracted once and cached in a
bitmap, similar to the disconnected elements IDs. This makes
boundary detection work as expected in all cases, solving a lot
of known issues with the smooth brush. In multires, this info is
extracted and cached only at the base mesh level, so it is much
more memory efficient than the previous automasking system.

- In order to keep the brushes responsive as they were before,
the automasking system can now skip creating the cache when it
is not needed for the requested options. This means that for
high poly meshes and simple automasking options the brushes
won't lag on start.

Reviewed By: sergey

Maniphest Tasks: T78747

Differential Revision: https://developer.blender.org/D8260
2020-07-15 16:33:25 +02:00
10cacbbb15 Fix T77417: Topology Automasking not working with individual vertices
The flood fill operation was setting the mask using to_v, so in the first
iteration when the floodfill callback was using the active vertex as
from_v and any other neighbor as to_v, the mask for the active vertex
was never set.

Now the mask is set using from_v and it checks if it should continue
propagating to the next neighbor using to_v.

Reviewed By: sergey

Maniphest Tasks: T77417

Differential Revision: https://developer.blender.org/D8294
2020-07-15 16:15:41 +02:00
613d314251 UV: support region fill for path select
This matches edit-mesh region selection (Ctrl-Shift-Select).
2020-07-15 23:20:25 +10:00
b3c34011c0 Cleanup: Replace 0 with False for boolean argument 2020-07-15 09:11:01 -04:00
efc6f6e1ae Clang-Tidy: ignore some newer checks
Those checks have been added to clang tidy within the last year.
They fail when I use a clang tidy version I built from source.

Reviewers: sergey

Differential Revision: https://developer.blender.org/D8302
2020-07-15 14:24:24 +02:00
5a11c8ba24 Fix T68845: Follow Active Quads, divide by zero error 2020-07-15 21:48:28 +10:00
87f8949f0e Fix T78930: Cycles OpenCL error on graphics cards that don't support half float 2020-07-15 13:38:04 +02:00
5764 changed files with 317553 additions and 223337 deletions

View File

@@ -238,6 +238,7 @@ ForEachMacros:
- LISTBASE_FOREACH_BACKWARD
- LISTBASE_FOREACH_MUTABLE
- LISTBASE_FOREACH_BACKWARD_MUTABLE
- LISTBASE_FOREACH_INDEX
- MAN_ITER_AXES_BEGIN
- NODE_INSTANCE_HASH_ITER
- NODE_SOCKET_TYPES_BEGIN
@@ -252,8 +253,8 @@ ForEachMacros:
- RNA_STRUCT_BEGIN_SKIP_RNA_TYPE
- SCULPT_VERTEX_DUPLICATES_AND_NEIGHBORS_ITER_BEGIN
- SCULPT_VERTEX_NEIGHBORS_ITER_BEGIN
- SEQP_BEGIN
- SEQ_BEGIN
- SEQ_ALL_BEGIN
- SEQ_CURRENT_BEGIN
- SURFACE_QUAD_ITER_BEGIN
- foreach
- ED_screen_areas_iter

View File

@@ -1,3 +1,6 @@
# The warnings below are disabled because they are too pedantic and not worth fixing.
# Some of them will be enabled as part of the Clang-Tidy task, see T78535.
Checks: >
-*,
readability-*,
@@ -12,32 +15,33 @@ Checks: >
-readability-misleading-indentation,
-readability-else-after-return,
-readability-inconsistent-declaration-parameter-name,
-readability-redundant-preprocessor,
-readability-function-size,
-readability-function-size,
-readability-redundant-string-init,
-readability-redundant-member-init,
-readability-const-return-type,
-readability-static-accessed-through-instance,
-readability-redundant-declaration,
-readability-qualified-auto,
-readability-use-anyofallof,
-readability-function-cognitive-complexity,
bugprone-*,
-bugprone-narrowing-conversions,
-bugprone-unhandled-self-assignment,
-bugprone-branch-clone,
-bugprone-macro-parentheses,
-bugprone-reserved-identifier,
-bugprone-sizeof-expression,
-bugprone-integer-division,
-bugprone-incorrect-roundings,
-bugprone-suspicious-string-compare,
-bugprone-not-null-terminated-result,
-bugprone-suspicious-missing-comma,
-bugprone-parent-virtual-call,
-bugprone-infinite-loop,
-bugprone-copy-constructor-init,
-bugprone-redundant-branch-condition,
modernize-*,
-modernize-use-auto,
-modernize-use-trailing-return-type,
-modernize-avoid-c-arrays,
-modernize-use-equals-default,
-modernize-use-nodiscard,
-modernize-loop-convert,
-modernize-pass-by-value,
-modernize-use-default-member-init,
-modernize-raw-string-literal,
-modernize-avoid-bind,
-modernize-use-transparent-functors,
WarningsAsErrors: '*'

169
.git-blame-ignore-revs Normal file
View File

@@ -0,0 +1,169 @@
# 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 smaller commits should be added to this list at once, because adding
# one extra commit (to edit this file) after every small cleanup is noisy.
#
# 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-Tidy, modernize-use-bool-literals
af35ada2f3fa8da4d46b3a71de724d353d716820
# Cleanup: Use nullptr everywhere in fluid code
311031ecd03dbfbf43e1df672a395f24b2e7d4d3
# Cleanup: Clang-Tidy, modernize-redundant-void-arg
a331d5c99299c4514ca33c843b1c79b872f2728d
# Cleanup: Clang-Tidy modernize-use-nullptr
16732def37c5a66f3ea28dbe247b09cc6bca6677
# Cleanup: Clang-tidy, modernize-concat-nested-namespaces
4525049aa0cf818f6483dce589ac9791eb562338
# Cleanup: Clang-tidy else-after-return
ae342ed4511cf2e144dcd27ce2c635d3d536f9ad
# Cleanup: Clang-Tidy, readability-redundant-member-init
190170d4cc92ff34abe1744a10474ac4f1074086
# Cleanup: use 'filepath' instead of 'name' for ImBuf utilities
99f56b4c16323f96c0cbf54e392fb509fcac5bda
# Cleanup: clang-format
c4d8f6a4a8ddc29ed27311ed7578b3c8c31399d2
b5d310b569e07a937798a2d38539cfd290149f1c
8c846cccd6bdfd3e90a695fabbf05f53e5466a57
40d4a4cb1a6b4c3c2a486e8f2868f547530e0811
4eac03d821fa17546f562485f7d073813a5e5943
# Cleanup: use preprocessor version check for PyTypeObject declaration
cd9acfed4f7674b84be965d469a367aef96f8af3
# Cycles: fix compilation of OSL shaders following API change
b980cd163a9d5d77eeffc2e353333e739fa9e719
# Cleanup: clang-tidy suppress warnings for PyTypeObject.tp_print
efd71aad4f22ec0073d80b8dd296015d3f395aa8
# Cleanup: fix wrong merge, remove extra unique_ptr.
6507449e54a167c63a72229e4d0119dd2af68ae5
# Cleanup: fix some clang tidy issues
525a042c5c7513c41240b118acca002f6c60cc12
# Fix T82520: error building freestyle with Python3.8
e118426e4695a97d67e65d69677f3c4e2db50a56
# Cleanup: Clang-tidy, readability-else-after-return
7be47dadea5066ae095c644e0b4f1f10d75f5ab3
# Cleanup: Add `r_` to return parameter
45dca05b1cd2a5ead59144c93d790fdfe7c35ee6
# Cleanup: Typo in `print_default_info` function name.
41a73909dec716642f044e60b40a28335c9fdb10
# Cleanup: Reduce indentation
1cc3a0e2cf73a5ff4f9e0a7f5338eda77266b300
# Build-system: Force C linkage for all DNA type headers
ad4b7741dba45a2be210942c18af6b6e4438f129
# Cleanup: Move function to proper section
c126e27cdc8b28365a9d5f9fafc4d521d1eb83df
# Cleanup: remove break after return statements
bbdfeb751e16d939482d2e4b95c4d470f53f18a5
# Cleanup: clang-tidy
af013ff76feef7e8b8ba642279c62a5dc275d59f
# Cleanup: Make panel type flag names more clear
9d28353b525ecfbcca1501be72e4276dfb2bbc2a

View File

@@ -41,10 +41,10 @@ if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})
endif()
endif()
cmake_minimum_required(VERSION 3.5)
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")
@@ -102,6 +102,11 @@ if(POLICY CMP0068)
cmake_policy(SET CMP0068 NEW)
endif()
# find_package() uses <PackageName>_ROOT variables.
if(POLICY CMP0074)
cmake_policy(SET CMP0074 NEW)
endif()
#-----------------------------------------------------------------------------
# Load some macros.
include(build_files/cmake/macros.cmake)
@@ -123,7 +128,9 @@ enable_testing()
set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin CACHE INTERNAL "" FORCE)
set(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/lib CACHE INTERNAL "" FORCE)
if(MSVC)
get_property(GENERATOR_IS_MULTI_CONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
if(GENERATOR_IS_MULTI_CONFIG)
set(TESTS_OUTPUT_DIR ${EXECUTABLE_OUTPUT_PATH}/tests/$<CONFIG>/ CACHE INTERNAL "" FORCE)
else()
set(TESTS_OUTPUT_DIR ${EXECUTABLE_OUTPUT_PATH}/tests/ CACHE INTERNAL "" FORCE)
@@ -171,6 +178,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)
@@ -183,6 +191,7 @@ if(APPLE)
else()
option(WITH_XR_OPENXR "Enable VR features through the OpenXR specification" ON)
endif()
option(WITH_GMP "Enable features depending on GMP (Exact Boolean)" ON)
# Compositor
option(WITH_COMPOSITOR "Enable the tile based nodal compositor" ON)
@@ -190,10 +199,12 @@ option(WITH_OPENIMAGEDENOISE "Enable the OpenImageDenoise compositing node" ON
option(WITH_OPENSUBDIV "Enable OpenSubdiv for surface subdivision" ON)
option(WITH_POTRACE "Enable features relying on potrace" ON)
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 rendering on the GPU" ON)
# GHOST Windowing Library Options
option(WITH_GHOST_DEBUG "Enable debugging output for the GHOST library" OFF)
@@ -367,7 +378,8 @@ 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_CUDA_BINARIES_ARCH sm_30 sm_35 sm_37 sm_50 sm_52 sm_60 sm_61 sm_70 sm_75 CACHE STRING "CUDA architectures to build binaries for")
set(CYCLES_TEST_DEVICES CPU CACHE STRING "Run regression tests on the specified device types (CPU CUDA OPTIX OPENCL)" )
set(CYCLES_CUDA_BINARIES_ARCH sm_30 sm_35 sm_37 sm_50 sm_52 sm_60 sm_61 sm_70 sm_75 sm_86 compute_75 CACHE STRING "CUDA architectures to build binaries for")
mark_as_advanced(CYCLES_CUDA_BINARIES_ARCH)
unset(PLATFORM_DEFAULT)
option(WITH_CYCLES_LOGGING "Build Cycles with logging support" ON)
@@ -415,8 +427,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()
@@ -428,6 +440,14 @@ if(WIN32)
option(WITH_TBB_MALLOC_PROXY "Enable the TBB malloc replacement" ON)
endif()
# This should be turned off when Blender enter beta/rc/release
if("${BLENDER_VERSION_CYCLE}" STREQUAL "release" OR
"${BLENDER_VERSION_CYCLE}" STREQUAL "rc")
set(WITH_EXPERIMENTAL_FEATURES OFF)
else()
set(WITH_EXPERIMENTAL_FEATURES ON)
endif()
# Unit testsing
option(WITH_GTESTS "Enable GTest unit testing" OFF)
option(WITH_OPENGL_RENDER_TESTS "Enable OpenGL render related unit testing (Experimental)" OFF)
@@ -498,9 +518,22 @@ if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang")
-fno-sanitize=alignment \
")
if(NOT MSVC) # not all sanitizers are supported with clang-cl, these two however are very vocal about it
set(_asan_defaults "${_asan_defaults} -fsanitize=leak -fsanitize=object-size" )
if(MSVC)
# clang-cl doesn't support all sanitizers, but leak and object-size give errors/warnings.
set(_asan_defaults "${_asan_defaults}")
elseif(APPLE)
# AppleClang doesn't support all sanitizers, but leak gives error.
# Build type is not known for multi-config generator, so don't add object-size sanitizer.
if(CMAKE_BUILD_TYPE MATCHES "Debug" OR GENERATOR_IS_MULTI_CONFIG)
# Silence the warning that object-size is not effective in -O0.
set(_asan_defaults "${_asan_defaults}")
else()
string(APPEND _asan_defaults " -fsanitize=object-size")
endif()
else()
string(APPEND _asan_defaults " -fsanitize=leak -fsanitize=object-size")
endif()
set(COMPILER_ASAN_CFLAGS "${_asan_defaults}" CACHE STRING "C flags for address sanitizer")
mark_as_advanced(COMPILER_ASAN_CFLAGS)
set(COMPILER_ASAN_CXXFLAGS "${_asan_defaults}" CACHE STRING "C++ flags for address sanitizer")
@@ -508,20 +541,42 @@ if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang")
unset(_asan_defaults)
if(NOT MSVC)
find_library(COMPILER_ASAN_LIBRARY asan ${CMAKE_C_IMPLICIT_LINK_DIRECTORIES})
else()
find_library(
COMPILER_ASAN_LIBRARY NAMES clang_rt.asan-x86_64
if(MSVC)
find_library(
COMPILER_ASAN_LIBRARY NAMES clang_rt.asan-x86_64
PATHS
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\LLVM\\LLVM;]/lib/clang/7.0.0/lib/windows
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\LLVM\\LLVM;]/lib/clang/6.0.0/lib/windows
)
elseif(APPLE)
execute_process(COMMAND ${CMAKE_CXX_COMPILER}
-print-file-name=lib
OUTPUT_VARIABLE CLANG_LIB_DIR
)
string(STRIP "${CLANG_LIB_DIR}" CLANG_LIB_DIR)
find_library(
COMPILER_ASAN_LIBRARY
NAMES
libclang_rt.asan_osx_dynamic.dylib
PATHS
"${CLANG_LIB_DIR}/darwin/"
)
unset(CLANG_LIB_DIR)
else()
find_library(
COMPILER_ASAN_LIBRARY asan ${CMAKE_C_IMPLICIT_LINK_DIRECTORIES}
)
endif()
mark_as_advanced(COMPILER_ASAN_LIBRARY)
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)
@@ -644,6 +699,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))
@@ -657,6 +714,9 @@ set_and_warn_dependency(WITH_TBB WITH_OPENIMAGEDENOISE OFF)
set_and_warn_dependency(WITH_TBB WITH_OPENVDB OFF)
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.
set_and_warn_dependency(WITH_IMAGE_OPENEXR WITH_OPENVDB OFF)
@@ -791,11 +851,10 @@ set(CXX_WARNINGS)
set(C_REMOVE_STRICT_FLAGS)
set(CXX_REMOVE_STRICT_FLAGS)
# libraries to link the binary with passed to target_link_libraries()
# known as LLIBS to scons
# Libraries to link to targets in setup_platform_linker_libs
set(PLATFORM_LINKLIBS "")
# Added to linker flags in setup_liblinks
# Added to target linker flags in setup_platform_linker_flags
# - CMAKE_EXE_LINKER_FLAGS
# - CMAKE_EXE_LINKER_FLAGS_DEBUG
set(PLATFORM_LINKFLAGS "")
@@ -803,15 +862,29 @@ set(PLATFORM_LINKFLAGS_DEBUG "")
if(NOT CMAKE_BUILD_TYPE MATCHES "Release")
if(WITH_COMPILER_ASAN)
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} ${COMPILER_ASAN_CFLAGS}")
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} ${COMPILER_ASAN_CFLAGS}")
if(NOT APPLE)
# Avoid passing address sanitizer compiler flags to `try_compile`.
# Since linker flags are not set, all compiler checks and `find_package`
# calls that rely on `try_compile` will fail.
# See CMP0066 also.
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")
endif()
if(COMPILER_ASAN_LIBRARY)
if(APPLE AND COMPILER_ASAN_LIBRARY)
string(REPLACE " " ";" _list_COMPILER_ASAN_CFLAGS ${COMPILER_ASAN_CFLAGS})
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}")
set(PLATFORM_LINKFLAGS_DEBUG "${COMPILER_ASAN_LIBRARY} ${COMPILER_ASAN_LINKER_FLAGS}")
@@ -879,11 +952,11 @@ endif()
# 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}")
string(PREPEND PLATFORM_CFLAGS "${COMPILER_SSE_FLAG} ")
add_definitions(-D__SSE__ -D__MMX__)
endif()
if(SUPPORT_SSE2_BUILD)
set(PLATFORM_CFLAGS " ${PLATFORM_CFLAGS} ${COMPILER_SSE2_FLAG}")
string(APPEND PLATFORM_CFLAGS " ${COMPILER_SSE2_FLAG}")
add_definitions(-D__SSE2__)
if(NOT SUPPORT_SSE_BUILD) # don't double up
add_definitions(-D__MMX__)
@@ -900,7 +973,7 @@ if(MSVC)
# endianess-detection and auto-setting is counterproductive
# so we just set endianness according CMAKE_OSX_ARCHITECTURES
elseif(CMAKE_OSX_ARCHITECTURES MATCHES i386 OR CMAKE_OSX_ARCHITECTURES MATCHES x86_64)
elseif(CMAKE_OSX_ARCHITECTURES MATCHES i386 OR CMAKE_OSX_ARCHITECTURES MATCHES x86_64 OR CMAKE_OSX_ARCHITECTURES MATCHES arm64)
add_definitions(-D__LITTLE_ENDIAN__)
elseif(CMAKE_OSX_ARCHITECTURES MATCHES ppc OR CMAKE_OSX_ARCHITECTURES MATCHES ppc64)
add_definitions(-D__BIG_ENDIAN__)
@@ -1095,8 +1168,8 @@ 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}")
else()
# Typically avoid adding flags as defines but we can't
# pass OpenMP flags to the linker for static builds, meaning
@@ -1413,10 +1486,12 @@ 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_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)
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)
@@ -1455,6 +1530,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)
@@ -1465,15 +1541,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")
@@ -1486,8 +1565,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
@@ -1518,7 +1597,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}")
@@ -1559,13 +1638,19 @@ if(WITH_PYTHON)
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)
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()
@@ -1578,12 +1663,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()
@@ -1628,10 +1748,6 @@ endif()
#-----------------------------------------------------------------------------
# Libraries
if(WITH_GTESTS)
include(GTestTesting)
endif()
if(WITH_BLENDER)
add_subdirectory(intern)
add_subdirectory(extern)
@@ -1691,7 +1807,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()
@@ -1709,23 +1825,24 @@ 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_CYCLES)
info_cfg_option(WITH_FFTW3)
info_cfg_option(WITH_FREESTYLE)
info_cfg_option(WITH_GMP)
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_QUADRIFLOW)
info_cfg_option(WITH_USD)
info_cfg_option(WITH_TBB)
info_cfg_option(WITH_USD)
info_cfg_option(WITH_XR_OPENXR)
info_cfg_text("Compiler Options:")
info_cfg_option(WITH_BUILDINFO)
@@ -1733,58 +1850,58 @@ 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_JACK)
info_cfg_option(WITH_JACK_DYNLOAD)
info_cfg_option(WITH_OPENAL)
info_cfg_option(WITH_SDL)
info_cfg_option(WITH_SDL_DYNLOAD)
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

@@ -81,11 +81,19 @@ Static Source Code Checking
* check_splint: Run blenders source through splint (C only).
* check_sparse: Run blenders source through sparse (C only).
* check_smatch: Run blenders source through smatch (C only).
* check_spelling_c: Check for spelling errors (C/C++ only).
* check_spelling_c_qtc: Same as check_spelling_c but outputs QtCreator tasks format.
* check_descriptions: Check for duplicate/invalid descriptions.
Spell Checkers
* 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).
* check_descriptions: Check for duplicate/invalid descriptions.
Note that spell checkers can take a 'CHECK_SPELLING_CACHE' filepath argument,
so re-running does not need to re-check unchanged files.
Example:
make check_spelling_c CHECK_SPELLING_CACHE=../spelling_cache.data
Utilities
Not associated with building Blender.
@@ -457,26 +465,17 @@ check_spelling_c: .FORCE
cd "$(BUILD_DIR)" ; \
PYTHONIOENCODING=utf_8 $(PYTHON) \
"$(BLENDER_DIR)/source/tools/check_source/check_spelling.py" \
--cache-file=$(CHECK_SPELLING_CACHE) \
"$(BLENDER_DIR)/source" \
"$(BLENDER_DIR)/intern/cycles" \
"$(BLENDER_DIR)/intern/guardedalloc" \
"$(BLENDER_DIR)/intern/ghost" \
check_spelling_c_qtc: .FORCE
cd "$(BUILD_DIR)" ; USE_QTC_TASK=1 \
PYTHONIOENCODING=utf_8 $(PYTHON) \
"$(BLENDER_DIR)/source/tools/check_source/check_spelling.py" \
"$(BLENDER_DIR)/source" \
"$(BLENDER_DIR)/intern/cycles" \
"$(BLENDER_DIR)/intern/guardedalloc" \
"$(BLENDER_DIR)/intern/ghost" \
> \
"$(BLENDER_DIR)/check_spelling_c.tasks"
check_spelling_osl: .FORCE
cd "$(BUILD_DIR)" ;\
PYTHONIOENCODING=utf_8 $(PYTHON) \
"$(BLENDER_DIR)/source/tools/check_source/check_spelling.py" \
--cache-file=$(CHECK_SPELLING_CACHE) \
"$(BLENDER_DIR)/intern/cycles/kernel/shaders"
check_descriptions: .FORCE
@@ -518,7 +517,7 @@ doc_py: .FORCE
ASAN_OPTIONS=halt_on_error=0 \
$(BLENDER_BIN) --background -noaudio --factory-startup \
--python doc/python_api/sphinx_doc_gen.py
cd doc/python_api ; sphinx-build -b html sphinx-in sphinx-out
sphinx-build -b html -j $(NPROCS) doc/python_api/sphinx-in doc/python_api/sphinx-out
@echo "docs written into: '$(BLENDER_DIR)/doc/python_api/sphinx-out/index.html'"
doc_doxy: .FORCE

View File

@@ -30,11 +30,11 @@
# build_deps 2015 x64 / build_deps 2015 x86
#
# MAC OS X USAGE:
# Install with homebrew: brew install cmake autoconf automake libtool yasm nasm bison
# Install with homebrew: brew install autoconf automake bison cmake libtool pkg-config yasm
# Run "make deps" from main Blender directory
#
# LINUX USAGE:
# Install compiler cmake autoconf automake libtool yasm nasm tcl
# Install compiler cmake autoconf automake libtool yasm tcl
# Run "make deps" from main Blender directory
#
####################################################################################################
@@ -57,7 +57,6 @@ include(cmake/zlib.cmake)
include(cmake/openal.cmake)
include(cmake/png.cmake)
include(cmake/jpeg.cmake)
include(cmake/boost.cmake)
include(cmake/blosc.cmake)
include(cmake/pthreads.cmake)
include(cmake/openexr.cmake)
@@ -76,6 +75,8 @@ include(cmake/llvm.cmake)
include(cmake/clang.cmake)
if(APPLE)
include(cmake/openmp.cmake)
endif()
if(UNIX)
include(cmake/nasm.cmake)
endif()
include(cmake/openimageio.cmake)
@@ -84,19 +85,21 @@ include(cmake/flexbison.cmake)
include(cmake/osl.cmake)
include(cmake/tbb.cmake)
include(cmake/openvdb.cmake)
include(cmake/nanovdb.cmake)
include(cmake/python.cmake)
include(cmake/python_site_packages.cmake)
include(cmake/package_python.cmake)
include(cmake/numpy.cmake)
include(cmake/usd.cmake)
if(UNIX)
# Rely on PugiXML compiled with OpenImageIO
else()
include(cmake/pugixml.cmake)
include(cmake/potrace.cmake)
# Boost needs to be included after python.cmake due to the PYTHON_BINARY variable being needed.
include(cmake/boost.cmake)
include(cmake/pugixml.cmake)
if((NOT APPLE) OR ("${CMAKE_OSX_ARCHITECTURES}" STREQUAL "x86_64"))
include(cmake/ispc.cmake)
include(cmake/openimagedenoise.cmake)
include(cmake/embree.cmake)
endif()
include(cmake/ispc.cmake)
include(cmake/openimagedenoise.cmake)
include(cmake/embree.cmake)
if(NOT APPLE)
include(cmake/xr_openxr.cmake)
endif()
@@ -111,10 +114,10 @@ if(WIN32)
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)
endif()
if(NOT WIN32 OR ENABLE_MINGW64)
include(cmake/gmp.cmake)
include(cmake/openjpeg.cmake)
if(NOT WIN32 OR BUILD_MODE STREQUAL Release)
if(WIN32)

View File

@@ -19,17 +19,6 @@
set(BOOST_ADDRESS_MODEL 64)
if(WIN32)
if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8")
set(PYTHON_ARCH x64)
set(PYTHON_ARCH2 win-AMD64)
set(PYTHON_OUTPUTDIR ${BUILD_DIR}/python/src/external_python/pcbuild/amd64/)
else()
set(PYTHON_ARCH x86)
set(PYTHON_ARCH2 win32)
set(PYTHON_OUTPUTDIR ${BUILD_DIR}/python/src/external_python/pcbuild/win32/)
set(BOOST_ADDRESS_MODEL 32)
endif()
set(BOOST_TOOLSET toolset=msvc-14.1)
set(BOOST_COMPILER_STRING -vc141)
@@ -60,6 +49,21 @@ else()
endif()
endif()
if(WITH_BOOST_PYTHON)
set(JAM_FILE ${BUILD_DIR}/boost.user-config.jam)
configure_file(${PATCH_DIR}/boost.user.jam.in ${JAM_FILE})
set(BOOST_PYTHON_OPTIONS
--with-python
--user-config=${JAM_FILE}
)
if(WIN32 AND BUILD_MODE STREQUAL Debug)
set(BOOST_PYTHON_OPTIONS
${BOOST_PYTHON_OPTIONS}
define=BOOST_DEBUG_PYTHON
)
endif()
endif()
set(BOOST_OPTIONS
--with-filesystem
--with-locale
@@ -76,6 +80,7 @@ set(BOOST_OPTIONS
-sNO_LZMA=1
-sNO_ZSTD=1
${BOOST_TOOLSET}
${BOOST_PYTHON_OPTIONS}
)
string(TOLOWER ${BUILD_MODE} BOOST_BUILD_TYPE)
@@ -92,3 +97,11 @@ ExternalProject_Add(external_boost
BUILD_IN_SOURCE 1
INSTALL_COMMAND "${BOOST_HARVEST_CMD}"
)
if(WITH_BOOST_PYTHON)
add_dependencies(
external_boost
external_python
external_numpy
)
endif()

View File

@@ -26,11 +26,11 @@ if(UNIX)
set(_required_software
autoconf
automake
${_libtoolize_name}
nasm
yasm
tclsh
bison
${_libtoolize_name}
pkg-config
tclsh
yasm
)
foreach(_software ${_required_software})
@@ -42,8 +42,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,10 +60,10 @@ if(UNIX)
" ${_software_missing}\n"
"\n"
"On Debian and Ubuntu:\n"
" apt install autoconf automake libtool yasm nasm tcl\n"
" apt install autoconf automake libtool yasm tcl\n"
"\n"
"On macOS (with homebrew):\n"
" brew install cmake autoconf automake libtool yasm nasm bison\n"
" brew install autoconf automake bison libtool pkg-config yasm\n"
"\n"
"Other platforms:\n"
" Install equivalent packages.\n")

View File

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

View File

@@ -52,6 +52,11 @@ if(APPLE)
--target-os=darwin
--x86asmexe=${LIBDIR}/nasm/bin/nasm
)
elseif(UNIX)
set(FFMPEG_EXTRA_FLAGS
${FFMPEG_EXTRA_FLAGS}
--x86asmexe=${LIBDIR}/nasm/bin/nasm
)
endif()
ExternalProject_Add(external_ffmpeg
@@ -95,8 +100,6 @@ ExternalProject_Add(external_ffmpeg
--disable-version3
--disable-debug
--enable-optimizations
--disable-sse
--disable-ssse3
--enable-ffplay
--disable-openssl
--disable-securetransport
@@ -144,7 +147,7 @@ if(WIN32)
external_zlib_mingw
)
endif()
if(APPLE)
if(UNIX)
add_dependencies(
external_ffmpeg
external_nasm

View File

@@ -0,0 +1,108 @@
# ***** 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(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 --enable-fat --host=x86_64-w64-mingw32 --build=x86_64-w64-mingw32)
else()
set(GMP_OPTIONS --enable-static --disable-shared )
endif()
if(APPLE)
if("${CMAKE_OSX_ARCHITECTURES}" STREQUAL "arm64")
set(GMP_OPTIONS
${GMP_OPTIONS}
--disable-assembly
)
else()
set(GMP_OPTIONS
${GMP_OPTIONS}
--with-pic
)
endif()
elseif(UNIX)
set(GMP_OPTIONS
${GMP_OPTIONS}
--with-pic
--enable-fat
)
endif()
ExternalProject_Add(external_gmp
URL ${GMP_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${GMP_HASH}
PREFIX ${BUILD_DIR}/gmp
CONFIGURE_COMMAND ${CONFIGURE_ENV_NO_PERL} && cd ${BUILD_DIR}/gmp/src/external_gmp/ && ${CONFIGURE_COMMAND} --prefix=${LIBDIR}/gmp ${GMP_OPTIONS} ${GMP_EXTRA_ARGS}
BUILD_COMMAND ${CONFIGURE_ENV_NO_PERL} && cd ${BUILD_DIR}/gmp/src/external_gmp/ && make -j${MAKE_THREADS}
INSTALL_COMMAND ${CONFIGURE_ENV_NO_PERL} && cd ${BUILD_DIR}/gmp/src/external_gmp/ && make install
INSTALL_DIR ${LIBDIR}/gmp
)
if(MSVC)
set_target_properties(external_gmp PROPERTIES FOLDER Mingw)
endif()
if(BUILD_MODE STREQUAL Release AND WIN32)
ExternalProject_Add_Step(external_gmp after_install
COMMAND ${CMAKE_COMMAND} -E copy ${BUILD_DIR}/gmp/src/external_gmp/.libs/libgmp-3.dll.def ${BUILD_DIR}/gmp/src/external_gmp/.libs/libgmp-10.def
COMMAND lib /def:${BUILD_DIR}/gmp/src/external_gmp/.libs/libgmp-10.def /machine:x64 /out:${BUILD_DIR}/gmp/src/external_gmp/.libs/libgmp-10.lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/gmp/bin/libgmp-10.dll ${HARVEST_TARGET}/gmp/lib/libgmp-10.dll
COMMAND ${CMAKE_COMMAND} -E copy ${BUILD_DIR}/gmp/src/external_gmp/.libs/libgmp-10.lib ${HARVEST_TARGET}/gmp/lib/libgmp-10.lib
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/gmp/include ${HARVEST_TARGET}/gmp/include
DEPENDEES install
)
endif()
if(BUILD_MODE STREQUAL Debug AND WIN32)
ExternalProject_Add_Step(external_gmp after_install
COMMAND ${CMAKE_COMMAND} -E copy ${BUILD_DIR}/gmp/src/external_gmp/.libs/libgmp-3.dll.def ${BUILD_DIR}/gmp/src/external_gmp/.libs/libgmp-10.def
COMMAND lib /def:${BUILD_DIR}/gmp/src/external_gmp/.libs/libgmp-10.def /machine:x64 /out:${BUILD_DIR}/gmp/src/external_gmp/.libs/libgmp-10.lib
DEPENDEES install
)
endif()
if(WIN32)
# gmpxx is somewhat special, it builds on top of the C style gmp library but exposes C++ bindings
# 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}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${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
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/gmpxx ${DEFAULT_CMAKE_FLAGS} -DGMP_LIBRARY=${BUILD_DIR}/gmp/src/external_gmp/.libs/libgmp-10.lib -DGMP_INCLUDE_DIR=${BUILD_DIR}/gmp/src/external_gmp -DCMAKE_DEBUG_POSTFIX=_d
INSTALL_DIR ${LIBDIR}/gmpxx
)
set_target_properties(external_gmpxx PROPERTIES FOLDER Mingw)
add_dependencies(
external_gmpxx
external_gmp
)
ExternalProject_Add_Step(external_gmpxx after_install
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/gmpxx/ ${HARVEST_TARGET}/gmp
DEPENDEES install
)
endif()

View File

@@ -26,6 +26,7 @@ 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
@@ -42,7 +43,7 @@ if(BUILD_MODE STREQUAL Release)
${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/ &&
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/tiff/include/ ${HARVEST_TARGET}/tiff/include/
DEPENDS
)
endif()
@@ -89,12 +90,18 @@ 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")
if(BUILD_CLANG_TOOLS)
harvest(clang/bin llvm/bin "clang-tidy")
harvest(clang/share/clang llvm/share "run-clang-tidy.py")
endif()
harvest(clang/include llvm/include "*")
harvest(llvm/include llvm/include "*")
harvest(llvm/bin llvm/bin "llvm-config")
@@ -132,14 +139,19 @@ 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")
if((NOT APPLE) OR ("${CMAKE_OSX_ARCHITECTURES}" STREQUAL "x86_64"))
harvest(openimagedenoise/include openimagedenoise/include "*")
harvest(openimagedenoise/lib openimagedenoise/lib "*.a")
harvest(embree/include embree/include "*.h")
harvest(embree/lib embree/lib "*.a")
endif()
harvest(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")
@@ -148,6 +160,8 @@ 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(pugixml/include pugixml/include "*.hpp")
harvest(pugixml/lib pugixml/lib "*.a")
harvest(python/bin python/bin "python${PYTHON_SHORT_VERSION}m")
harvest(python/include python/include "*h")
harvest(python/lib python/lib "*")
@@ -168,11 +182,11 @@ 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(embree/include embree/include "*.h")
harvest(embree/lib embree/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*")

View File

@@ -25,8 +25,13 @@ if(WIN32)
elseif(APPLE)
# Use bison installed via Homebrew.
# The one which comes which Xcode toolset is too old.
if("${CMAKE_HOST_SYSTEM_PROCESSOR}" STREQUAL "arm64")
set(HOMEBREW_LOCATION "/opt/homebrew")
else()
set(HOMEBREW_LOCATION "/usr/local")
endif()
set(ISPC_EXTRA_ARGS_APPLE
-DBISON_EXECUTABLE=/usr/local/opt/bison/bin/bison
-DBISON_EXECUTABLE=${HOMEBREW_LOCATION}/opt/bison/bin/bison
)
elseif(UNIX)
set(ISPC_EXTRA_ARGS_UNIX
@@ -43,6 +48,7 @@ set(ISPC_EXTRA_ARGS
-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++
-DISPC_INCLUDE_TESTS=Off
-DCLANG_LIBRARY_DIR=${LIBDIR}/clang/lib
-DCLANG_INCLUDE_DIRS=${LIBDIR}/clang/include
@@ -73,4 +79,3 @@ if(WIN32)
external_flexbison
)
endif()

View File

@@ -59,4 +59,4 @@ else(WIN32)
)
set(JPEG_LIBRARY libjpeg${LIBEXT})
endif(WIN32)
endif()

View File

@@ -16,11 +16,17 @@
#
# ***** END GPL LICENSE BLOCK *****
if(APPLE AND "${CMAKE_OSX_ARCHITECTURES}" STREQUAL "arm64")
set(LLVM_TARGETS AArch64)
else()
set(LLVM_TARGETS X86)
endif()
set(LLVM_EXTRA_ARGS
-DLLVM_USE_CRT_RELEASE=MD
-DLLVM_USE_CRT_DEBUG=MDd
-DLLVM_INCLUDE_TESTS=OFF
-DLLVM_TARGETS_TO_BUILD=X86
-DLLVM_TARGETS_TO_BUILD=${LLVM_TARGETS}
-DLLVM_INCLUDE_EXAMPLES=OFF
-DLLVM_ENABLE_TERMINFO=OFF
-DLLVM_BUILD_LLVM_C_DYLIB=OFF

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 ${NANOVDB_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${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

@@ -38,6 +38,7 @@ ExternalProject_Add(external_numpy
PREFIX ${BUILD_DIR}/numpy
PATCH_COMMAND ${NUMPY_PATCH}
CONFIGURE_COMMAND ""
PATCH_COMMAND COMMAND ${PATCH_CMD} -p 1 -d ${BUILD_DIR}/numpy/src/external_numpy < ${PATCH_DIR}/numpy.diff
LOG_BUILD 1
BUILD_COMMAND ${PYTHON_BINARY} ${BUILD_DIR}/numpy/src/external_numpy/setup.py build ${NUMPY_BUILD_OPTION} install --old-and-unmanageable
INSTALL_COMMAND ""

View File

@@ -30,6 +30,13 @@ set(OPENCOLORIO_EXTRA_ARGS
-DOCIO_STATIC_JNIGLUE=OFF
)
if(APPLE AND NOT("${CMAKE_OSX_ARCHITECTURES}" STREQUAL "x86_64"))
set(OPENCOLORIO_EXTRA_ARGS
${OPENCOLORIO_EXTRA_ARGS}
-DOCIO_USE_SSE=OFF
)
endif()
if(WIN32)
set(OCIO_PATCH opencolorio_win.diff)
set(OPENCOLORIO_EXTRA_ARGS

View File

@@ -112,6 +112,9 @@ 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}
)
@@ -134,6 +137,7 @@ add_dependencies(
external_jpeg
external_boost
external_tiff
external_pugixml
external_openjpeg${OPENJPEG_POSTFIX}
${WEBP_DEP}
)

View File

@@ -22,6 +22,7 @@ ExternalProject_Add(external_openmp
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${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}
INSTALL_COMMAND cd ${BUILD_DIR}/openmp/src/external_openmp-build && install_name_tool -id @executable_path/../Resources/lib/libomp.dylib runtime/src/libomp.dylib && make install
INSTALL_DIR ${LIBDIR}/openmp

View File

@@ -20,6 +20,14 @@ if(BUILD_MODE STREQUAL Debug)
set(BLOSC_POST _d)
endif()
if(WIN32)
set(OPENVDB_SHARED ON)
set(OPENVDB_STATIC OFF)
else()
set(OPENVDB_SHARED OFF)
set(OPENVDB_STATIC ON)
endif()
set(OPENVDB_EXTRA_ARGS
-DBoost_COMPILER:STRING=${BOOST_COMPILER_STRING}
-DBoost_USE_MULTITHREADED=ON
@@ -42,8 +50,10 @@ set(OPENVDB_EXTRA_ARGS
-DOPENEXR_LIBRARYDIR=${LIBDIR}/openexr/lib
# All libs live in openexr, even the ilmbase ones
-DILMBASE_LIBRARYDIR=${LIBDIR}/openexr/lib
-DOPENVDB_CORE_SHARED=Off
-DOPENVDB_CORE_SHARED=${OPENVDB_SHARED}
-DOPENVDB_CORE_STATIC=${OPENVDB_STATIC}
-DOPENVDB_BUILD_BINARIES=Off
-DCMAKE_DEBUG_POSTFIX=_d
)
if(WIN32)
@@ -86,14 +96,16 @@ add_dependencies(
if(WIN32)
if(BUILD_MODE STREQUAL Release)
ExternalProject_Add_Step(openvdb after_install
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/openvdb/include ${HARVEST_TARGET}/openvdb/include
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/openvdb/lib/libopenvdb.lib ${HARVEST_TARGET}/openvdb/lib/openvdb.lib
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/openvdb/include/openvdb ${HARVEST_TARGET}/openvdb/include/openvdb
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/openvdb/lib/openvdb.lib ${HARVEST_TARGET}/openvdb/lib/openvdb.lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/openvdb/bin/openvdb.dll ${HARVEST_TARGET}/openvdb/bin/openvdb.dll
DEPENDEES install
)
endif()
if(BUILD_MODE STREQUAL Debug)
ExternalProject_Add_Step(openvdb after_install
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/openvdb/lib/libopenvdb.lib ${HARVEST_TARGET}/openvdb/lib/openvdb_d.lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/openvdb/lib/openvdb_d.lib ${HARVEST_TARGET}/openvdb/lib/openvdb_d.lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/openvdb/bin/openvdb_d.dll ${HARVEST_TARGET}/openvdb/bin/openvdb_d.dll
DEPENDEES install
)
endif()

View File

@@ -20,6 +20,7 @@ if(WIN32)
option(ENABLE_MINGW64 "Enable building of ffmpeg/iconv/libsndfile/fftw3 by installing mingw64" ON)
endif()
option(WITH_WEBP "Enable building of oiio with webp support" OFF)
option(WITH_BOOST_PYTHON "Enable building of boost with python support" OFF)
set(MAKE_THREADS 1 CACHE STRING "Number of threads to run make with")
if(NOT BUILD_MODE)
@@ -55,7 +56,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()
@@ -117,16 +118,28 @@ else()
COMMAND xcodebuild -version -sdk macosx SDKVersion
OUTPUT_VARIABLE MACOSX_SDK_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE)
set(OSX_ARCHITECTURES x86_64)
set(OSX_DEPLOYMENT_TARGET 10.13)
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}")
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}")
set(PLATFORM_CXXFLAGS "-isysroot ${OSX_SYSROOT} -mmacosx-version-min=${OSX_DEPLOYMENT_TARGET} -std=c++11 -stdlib=libc++")
set(PLATFORM_LDFLAGS "-isysroot ${OSX_SYSROOT} -mmacosx-version-min=${OSX_DEPLOYMENT_TARGET}")
set(PLATFORM_BUILD_TARGET --build=x86_64-apple-darwin17.0.0) # OS X 10.13
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}")
if("${CMAKE_OSX_ARCHITECTURES}" STREQUAL "x86_64")
set(PLATFORM_BUILD_TARGET --build=x86_64-apple-darwin17.0.0) # OS X 10.13
else()
set(PLATFORM_BUILD_TARGET --build=aarch64-apple-darwin20.0.0) # macOS 11.00
endif()
set(PLATFORM_CMAKE_FLAGS
-DCMAKE_OSX_ARCHITECTURES:STRING=${OSX_ARCHITECTURES}
-DCMAKE_OSX_ARCHITECTURES:STRING=${CMAKE_OSX_ARCHITECTURES}
-DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=${OSX_DEPLOYMENT_TARGET}
-DCMAKE_OSX_SYSROOT:PATH=${OSX_SYSROOT}
)
@@ -182,18 +195,6 @@ set(DEFAULT_CMAKE_FLAGS
${PLATFORM_CMAKE_FLAGS}
)
if(WIN32)
# We need both flavors to build the thumbnail dlls
if(MSVC12)
set(GENERATOR_32 "Visual Studio 12 2013")
set(GENERATOR_64 "Visual Studio 12 2013 Win64")
elseif(MSVC14)
set(GENERATOR_32 "Visual Studio 14 2015")
set(GENERATOR_64 "Visual Studio 14 2015 Win64")
endif()
endif()
if(WIN32)
if(BUILD_MODE STREQUAL Debug)
set(ZLIB_LIBRARY zlibstaticd${LIBEXT})

View File

@@ -78,14 +78,10 @@ set(OSL_EXTRA_ARGS
-DINSTALL_DOCS=OFF
${OSL_SIMD_FLAGS}
-DPARTIO_LIBRARIES=
-DPUGIXML_HOME=${LIBDIR}/pugixml
)
if(WIN32)
set(OSL_EXTRA_ARGS
${OSL_EXTRA_ARGS}
-DPUGIXML_HOME=${LIBDIR}/pugixml
)
elseif(APPLE)
if(APPLE)
# Make symbol hiding consistent with OIIO which defaults to OFF,
# avoids linker warnings on macOS
set(OSL_EXTRA_ARGS
@@ -114,17 +110,9 @@ add_dependencies(
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

@@ -22,6 +22,10 @@ set(PNG_EXTRA_ARGS
-DPNG_STATIC=ON
)
if(APPLE AND ("${CMAKE_OSX_ARCHITECTURES}" STREQUAL "arm64"))
set(PNG_EXTRA_ARGS ${PNG_EXTRA_ARGS} -DPNG_HARDWARE_OPTIMIZATIONS=ON -DPNG_ARM_NEON=on -DCMAKE_SYSTEM_PROCESSOR="aarch64")
endif()
ExternalProject_Add(external_png
URL ${PNG_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR}

View File

@@ -0,0 +1,38 @@
# ***** 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(POTRACE_EXTRA_ARGS
)
if((WIN32 AND BUILD_MODE STREQUAL Release) OR UNIX)
ExternalProject_Add(external_potrace
URL ${POTRACE_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${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}
INSTALL_DIR ${LIBDIR}/potrace
)
if(WIN32)
ExternalProject_Add_Step(external_potrace after_install
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/potrace ${HARVEST_TARGET}/potrace
DEPENDEES install
)
endif()
endif()

View File

@@ -30,14 +30,14 @@ 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()
endif()
endif()
endif()

View File

@@ -42,7 +42,7 @@ if(WIN32)
URL_HASH MD5=${PYTHON_HASH}
PREFIX ${BUILD_DIR}/python
CONFIGURE_COMMAND ""
BUILD_COMMAND cd ${BUILD_DIR}/python/src/external_python/pcbuild/ && set IncludeTkinter=false && call build.bat -e -p ${PYTHON_ARCH} -c ${BUILD_MODE}
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
)
@@ -69,12 +69,17 @@ else()
export ac_cv_header_libintl_h=no &&
export ac_cv_lib_intl_textdomain=no
)
if("${CMAKE_OSX_ARCHITECTURES}" STREQUAL "arm64")
set(PYTHON_FUNC_CONFIGS ${PYTHON_FUNC_CONFIGS} && export PYTHON_DECIMAL_WITH_MACHINE=ansi64)
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)
endif()
set(PYTHON_PATCH ${PATCH_CMD} --verbose -p1 -d ${BUILD_DIR}/python/src/external_python < ${PATCH_DIR}/python_linux.diff)
endif()
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")
@@ -84,7 +89,6 @@ else()
export CPPFLAGS=${PYTHON_CFLAGS} &&
export LDFLAGS=${PYTHON_LDFLAGS} &&
export PKG_CONFIG_PATH=${LIBDIR}/ffi/lib/pkgconfig)
set(PYTHON_PATCH ${PATCH_CMD} --verbose -p1 -d ${BUILD_DIR}/python/src/external_python < ${PATCH_DIR}/python_linux.diff)
ExternalProject_Add(external_python
URL ${PYTHON_URI}

View File

@@ -51,7 +51,7 @@ ExternalProject_Add(external_sqlite
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH SHA1=${SQLITE_HASH}
PREFIX ${BUILD_DIR}/sqlite
PATCH_COMMAND ${SQLITE_PATCH_CMD}
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

@@ -20,7 +20,7 @@ set(SSL_CONFIGURE_COMMAND ./Configure)
set(SSL_PATCH_CMD echo .)
if(APPLE)
set(SSL_OS_COMPILER "blender-darwin-x86_64")
set(SSL_OS_COMPILER "blender-darwin-${CMAKE_OSX_ARCHITECTURES}")
else()
if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8")
set(SSL_EXTRA_ARGS enable-ec_nistp_64_gcc_128)

View File

@@ -12,4 +12,9 @@ my %targets = (
inherit_from => [ "darwin64-x86_64-cc" ],
cflags => add("-fPIC"),
},
"blender-darwin-arm64" => {
inherit_from => [ "darwin-common" ],
cxxflags => add("-fPIC -arch arm64"),
cflags => add("-fPIC -arch arm64"),
},
);

View File

@@ -27,6 +27,7 @@ ExternalProject_Add(external_theora
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH SHA256=${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
--disable-shared
--enable-static

View File

@@ -120,6 +120,9 @@ set(LLVM_HASH 31eb9ce73dd2a0f8dcab8319fb03f8fc)
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(CLANG_TOOLS_URI https://github.com/llvm/llvm-project/releases/download/llvmorg-${LLVM_VERSION}/clang-tools-extra-${LLVM_VERSION}.src.tar.xz)
set(CLANG_TOOLS_HASH c76293870b564c6a7968622b475b7646)
set(OPENMP_URI https://github.com/llvm/llvm-project/releases/download/llvmorg-${LLVM_VERSION}/openmp-${LLVM_VERSION}.src.tar.xz)
set(OPENMP_HASH 6eade16057edbdecb3c4eef9daa2bfcf)
@@ -146,9 +149,13 @@ set(TBB_URI https://github.com/oneapi-src/oneTBB/archive/${TBB_VERSION}.tar.gz)
set(TBB_HASH 26263622e9187212ec240dcf01b66207)
set(OPENVDB_VERSION 7.0.0)
set(OPENVDB_URI https://github.com/dreamworksanimation/openvdb/archive/v${OPENVDB_VERSION}.tar.gz)
set(OPENVDB_URI https://github.com/AcademySoftwareFoundation/openvdb/archive/v${OPENVDB_VERSION}.tar.gz)
set(OPENVDB_HASH fd6c4f168282f7e0e494d290cd531fa8)
set(NANOVDB_GIT_UID e62f7a0bf1e27397223c61ddeaaf57edf111b77f)
set(NANOVDB_URI https://github.com/AcademySoftwareFoundation/openvdb/archive/${NANOVDB_GIT_UID}.tar.gz)
set(NANOVDB_HASH 90919510bc6ccd630fedc56f748cb199)
set(IDNA_VERSION 2.9)
set(CHARDET_VERSION 3.0.4)
set(URLLIB3_VERSION 1.25.9)
@@ -293,9 +300,9 @@ set(USD_VERSION 20.05)
set(USD_URI https://github.com/PixarAnimationStudios/USD/archive/v${USD_VERSION}.tar.gz)
set(USD_HASH 6d679e739e7f65725d9c029e37dda9fc)
set(OIDN_VERSION 1.2.1)
set(OIDN_VERSION 1.2.3)
set(OIDN_URI https://github.com/OpenImageDenoise/oidn/releases/download/v${OIDN_VERSION}/oidn-${OIDN_VERSION}.src.tar.gz)
set(OIDN_HASH cbebc1a25eb6de62af3a59e943063608)
set(OIDN_HASH 1f11466c2c3efc27faba5ec7078d12b2)
set(LIBGLU_VERSION 9.0.1)
set(LIBGLU_URI ftp://ftp.freedesktop.org/pub/mesa/glu/glu-${LIBGLU_VERSION}.tar.xz)
@@ -312,6 +319,15 @@ set(NASM_HASH f4fd1329b1713e1ccd34b2fc121c4bcd278c9f91cc4cb205ae8fcd2e4728dd14)
set(XR_OPENXR_SDK_VERSION 1.0.8)
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(ISPC_VERSION v1.13.0)
set(ISPC_VERSION v1.14.1)
set(ISPC_URI https://github.com/ispc/ispc/archive/${ISPC_VERSION}.tar.gz)
set(ISPC_HASH 4bf5e8d0020c4b9980faa702c1a6f25f)
set(ISPC_HASH 968fbc8dfd16a60ba4e32d2e0e03ea7a)
set(GMP_VERSION 6.2.0)
set(GMP_URI https://gmplib.org/download/gmp/gmp-${GMP_VERSION}.tar.xz)
set(GMP_HASH a325e3f09e6d91e62101e59f9bda3ec1)
set(POTRACE_VERSION 1.16)
set(POTRACE_URI http://potrace.sourceforge.net/download/${POTRACE_VERSION}/potrace-${POTRACE_VERSION}.tar.gz)
set(POTRACE_HASH 5f0bd87ddd9a620b0c4e65652ef93d69)

View File

@@ -24,7 +24,11 @@ if(WIN32)
endif()
else()
if(APPLE)
set(VPX_EXTRA_FLAGS --target=x86_64-darwin13-gcc)
if("${CMAKE_OSX_ARCHITECTURES}" STREQUAL "arm64")
set(VPX_EXTRA_FLAGS --target=generic-gnu)
else()
set(VPX_EXTRA_FLAGS --target=x86_64-darwin17-gcc)
endif()
else()
set(VPX_EXTRA_FLAGS --target=generic-gnu)
endif()

View File

@@ -22,11 +22,22 @@ endif()
if(APPLE)
if("${CMAKE_OSX_ARCHITECTURES}" STREQUAL "arm64")
set(X264_EXTRA_ARGS ${X264_EXTRA_ARGS} "--disable-asm")
set(X264_CONFIGURE_ENV echo .)
else()
set(X264_CONFIGURE_ENV
export AS=${LIBDIR}/nasm/bin/nasm
)
endif()
else()
set(X264_CONFIGURE_ENV echo .)
endif()
if(UNIX AND NOT APPLE)
set(X264_CONFIGURE_ENV
export AS=${LIBDIR}/nasm/bin/nasm
)
else()
set(X264_CONFIGURE_ENV echo .)
endif()
ExternalProject_Add(external_x264
@@ -49,7 +60,7 @@ if(MSVC)
set_target_properties(external_x264 PROPERTIES FOLDER Mingw)
endif()
if(APPLE)
if(UNIX)
add_dependencies(
external_x264
external_nasm

File diff suppressed because it is too large Load Diff

View File

@@ -91,3 +91,41 @@ diff -Naur external_blosc.orig/blosc/blosc.c external_blosc/blosc/blosc.c
/* Some useful units */
diff --git a/blosc/shuffle.c b/blosc/shuffle.c
index 84b5095..23053b4 100644
--- a/blosc/shuffle.c
+++ b/blosc/shuffle.c
@@ -490,12 +490,12 @@ void unshuffle(size_t bytesoftype, size_t blocksize,
#else /* no __SSE2__ available */
void shuffle(size_t bytesoftype, size_t blocksize,
- uint8_t* _src, uint8_t* _dest) {
+ const uint8_t* _src, uint8_t* _dest) {
_shuffle(bytesoftype, blocksize, _src, _dest);
}
void unshuffle(size_t bytesoftype, size_t blocksize,
- uint8_t* _src, uint8_t* _dest) {
+ const uint8_t* _src, uint8_t* _dest) {
_unshuffle(bytesoftype, blocksize, _src, _dest);
}
--- a/cmake/FindSSE.cmake
+++ b/cmake/FindSSE.cmake
@@ -49,6 +49,17 @@
set(AVX_FOUND false CACHE BOOL "AVX available on host")
ENDIF (AVX_TRUE)
ELSEIF(CMAKE_SYSTEM_NAME MATCHES "Darwin")
+ execute_process(COMMAND uname -m OUTPUT_VARIABLE ARCHITECTURE OUTPUT_STRIP_TRAILING_WHITESPACE)
+ message(STATUS "Detected architecture ${ARCHITECTURE}")
+ IF("${ARCHITECTURE}" STREQUAL "arm64")
+ set(SSE2_FOUND false CACHE BOOL "SSE2 available on host")
+ set(SSE3_FOUND false CACHE BOOL "SSE3 available on host")
+ set(SSSE3_FOUND false CACHE BOOL "SSSE3 available on host")
+ set(SSE4_1_FOUND false CACHE BOOL "SSE4.1 available on host")
+ set(AVX_FOUND false CACHE BOOL "AVX available on host")
+ return()
+ ENDIF()
+
EXEC_PROGRAM("/usr/sbin/sysctl -n machdep.cpu.features" OUTPUT_VARIABLE
CPUINFO)

View File

@@ -0,0 +1,4 @@
using python : @PYTHON_SHORT_VERSION@ : @PYTHON_BINARY@
: @LIBDIR@/python/include @LIBDIR@/python/include/python@PYTHON_SHORT_VERSION@m/
: @LIBDIR@/python/libs
;

View File

@@ -0,0 +1,22 @@
cmake_minimum_required(VERSION 3.1)
project(libgmpxx)
include_directories(. cxx ${GMP_INCLUDE_DIR})
add_definitions(-D__GMP_WITHIN_GMPXX)
add_library(libgmpxx SHARED
cxx/dummy.cc
cxx/isfuns.cc
cxx/ismpf.cc
cxx/ismpq.cc
cxx/ismpz.cc
cxx/ismpznw.cc
cxx/limits.cc
cxx/osdoprnti.cc
cxx/osfuns.cc
cxx/osmpf.cc
cxx/osmpq.cc
cxx/osmpz.cc
)
target_link_libraries(libgmpxx ${GMP_LIBRARY})
install(TARGETS libgmpxx DESTINATION lib)

View File

@@ -0,0 +1,54 @@
project(potrace)
cmake_minimum_required(VERSION 2.8)
include_directories(src/include)
set(SOURCES
src/backend_dxf.c
src/backend_eps.c
src/backend_geojson.c
src/backend_pdf.c
src/backend_pgm.c
src/backend_svg.c
src/backend_xfig.c
src/bbox.c
src/bitmap_io.c
src/curve.c
src/decompose.c
src/flate.c
src/greymap.c
src/lzw.c
src/potracelib.c
src/progress_bar.c
src/render.c
src/trace.c
src/trans.c
)
set(HEADERS
src/potracelib.h
)
if(WIN32)
add_definitions(/D_USE_MATH_DEFINES)
endif()
add_definitions(/DPOTRACE="POTrace")
add_definitions(/DVERSION="Blender")
add_definitions(/DHAVE_INTTYPES_H)
add_library(${PROJECT_NAME} STATIC ${HEADERS} ${SOURCES})
set_target_properties(${PROJECT_NAME} PROPERTIES
LIBRARY_OUTPUT_NAME "${PROJECT_NAME}"
PUBLIC_HEADER "${HEADERS}"
)
install(TARGETS ${PROJECT_NAME}
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
PUBLIC_HEADER DESTINATION include
)

View File

@@ -0,0 +1,668 @@
/* config.h. Generated from config.in by configure. */
/* config.in. Generated from configure.ac by autoheader. */
/*
Copyright 1996-2020 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
The GNU MP Library is free software; you can redistribute it and/or modify
it under the terms of either:
* the GNU Lesser General Public License as published by the Free
Software Foundation; either version 3 of the License, or (at your
option) any later version.
or
* 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.
or both in parallel, as here.
The GNU MP Library 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 copies of the GNU General Public License and the
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/.
*/
/* Define if building universal (internal helper macro) */
/* #undef AC_APPLE_UNIVERSAL_BUILD */
/* The gmp-mparam.h file (a string) the tune program should suggest updating.
*/
#define GMP_MPARAM_H_SUGGEST "./mpn/x86_64/coreisbr/gmp-mparam.h"
/* Define to 1 if you have the `alarm' function. */
#define HAVE_ALARM 1
/* Define to 1 if alloca() works (via gmp-impl.h). */
#define HAVE_ALLOCA 1
/* Define to 1 if you have <alloca.h> and it should be used (not on Ultrix).
*/
/* #undef HAVE_ALLOCA_H */
/* Define to 1 if the compiler accepts gcc style __attribute__ ((const)) */
//#define HAVE_ATTRIBUTE_CONST 1
/* Define to 1 if the compiler accepts gcc style __attribute__ ((malloc)) */
//#define HAVE_ATTRIBUTE_MALLOC 1
/* Define to 1 if the compiler accepts gcc style __attribute__ ((mode (XX)))
*/
//#define HAVE_ATTRIBUTE_MODE 1
/* Define to 1 if the compiler accepts gcc style __attribute__ ((noreturn)) */
//#define HAVE_ATTRIBUTE_NORETURN 1
/* Define to 1 if you have the `attr_get' function. */
/* #undef HAVE_ATTR_GET */
/* Define to 1 if tests/libtests has calling conventions checking for the CPU
*/
/* #undef HAVE_CALLING_CONVENTIONS */
/* Define to 1 if you have the `clock' function. */
#define HAVE_CLOCK 1
/* Define to 1 if you have the `clock_gettime' function */
/* #undef HAVE_CLOCK_GETTIME */
/* Define to 1 if you have the `cputime' function. */
/* #undef HAVE_CPUTIME */
/* Define to 1 if you have the declaration of `fgetc', and to 0 if you don't.
*/
#define HAVE_DECL_FGETC 1
/* Define to 1 if you have the declaration of `fscanf', and to 0 if you don't.
*/
#define HAVE_DECL_FSCANF 1
/* Define to 1 if you have the declaration of `optarg', and to 0 if you don't.
*/
#define HAVE_DECL_OPTARG 1
/* Define to 1 if you have the declaration of `sys_errlist', and to 0 if you
don't. */
#define HAVE_DECL_SYS_ERRLIST 0
/* Define to 1 if you have the declaration of `sys_nerr', and to 0 if you
don't. */
#define HAVE_DECL_SYS_NERR 0
/* Define to 1 if you have the declaration of `ungetc', and to 0 if you don't.
*/
#define HAVE_DECL_UNGETC 1
/* Define to 1 if you have the declaration of `vfprintf', and to 0 if you
don't. */
#define HAVE_DECL_VFPRINTF 1
/* Define to 1 if you have the <dlfcn.h> header file. */
/* #undef HAVE_DLFCN_H */
/* Define one of the following to 1 for the format of a `double'.
If your format is not among these choices, or you don't know what it is,
then leave all undefined.
IEEE_LITTLE_SWAPPED means little endian, but with the two 4-byte halves
swapped, as used by ARM CPUs in little endian mode. */
/* #undef HAVE_DOUBLE_IEEE_BIG_ENDIAN */
#define HAVE_DOUBLE_IEEE_LITTLE_ENDIAN 1
/* #undef HAVE_DOUBLE_IEEE_LITTLE_SWAPPED */
/* #undef HAVE_DOUBLE_VAX_D */
/* #undef HAVE_DOUBLE_VAX_G */
/* #undef HAVE_DOUBLE_CRAY_CFP */
/* Define to 1 if you have the <fcntl.h> header file. */
#define HAVE_FCNTL_H 1
/* Define to 1 if you have the <float.h> header file. */
#define HAVE_FLOAT_H 1
/* Define to 1 if you have the `getpagesize' function. */
#define HAVE_GETPAGESIZE 1
/* Define to 1 if you have the `getrusage' function. */
/* #undef HAVE_GETRUSAGE */
/* Define to 1 if you have the `getsysinfo' function. */
/* #undef HAVE_GETSYSINFO */
/* Define to 1 if you have the `gettimeofday' function. */
#define HAVE_GETTIMEOFDAY 1
/* Define to 1 if the compiler accepts gcc style __attribute__ ((visibility))
and __attribute__ ((alias)) */
#define HAVE_HIDDEN_ALIAS 1
/* Define one of these to 1 for the host CPU family.
If your CPU is not in any of these families, leave all undefined.
For an AMD64 chip, define "x86" in ABI=32, but not in ABI=64. */
/* #undef HAVE_HOST_CPU_FAMILY_alpha */
/* #undef HAVE_HOST_CPU_FAMILY_m68k */
/* #undef HAVE_HOST_CPU_FAMILY_power */
/* #undef HAVE_HOST_CPU_FAMILY_powerpc */
/* #undef HAVE_HOST_CPU_FAMILY_x86 */
#define HAVE_HOST_CPU_FAMILY_x86_64 1
/* Define one of the following to 1 for the host CPU, as per the output of
./config.guess. If your CPU is not listed here, leave all undefined. */
/* #undef HAVE_HOST_CPU_alphaev67 */
/* #undef HAVE_HOST_CPU_alphaev68 */
/* #undef HAVE_HOST_CPU_alphaev7 */
/* #undef HAVE_HOST_CPU_m68020 */
/* #undef HAVE_HOST_CPU_m68030 */
/* #undef HAVE_HOST_CPU_m68040 */
/* #undef HAVE_HOST_CPU_m68060 */
/* #undef HAVE_HOST_CPU_m68360 */
/* #undef HAVE_HOST_CPU_powerpc604 */
/* #undef HAVE_HOST_CPU_powerpc604e */
/* #undef HAVE_HOST_CPU_powerpc750 */
/* #undef HAVE_HOST_CPU_powerpc7400 */
/* #undef HAVE_HOST_CPU_supersparc */
/* #undef HAVE_HOST_CPU_i386 */
/* #undef HAVE_HOST_CPU_i586 */
/* #undef HAVE_HOST_CPU_i686 */
/* #undef HAVE_HOST_CPU_pentium */
/* #undef HAVE_HOST_CPU_pentiummmx */
/* #undef HAVE_HOST_CPU_pentiumpro */
/* #undef HAVE_HOST_CPU_pentium2 */
/* #undef HAVE_HOST_CPU_pentium3 */
/* #undef HAVE_HOST_CPU_pentium4 */
/* #undef HAVE_HOST_CPU_core2 */
/* #undef HAVE_HOST_CPU_nehalem */
/* #undef HAVE_HOST_CPU_westmere */
/* #undef HAVE_HOST_CPU_sandybridge */
#define HAVE_HOST_CPU_ivybridge 1
/* #undef HAVE_HOST_CPU_haswell */
/* #undef HAVE_HOST_CPU_broadwell */
/* #undef HAVE_HOST_CPU_skylake */
/* #undef HAVE_HOST_CPU_silvermont */
/* #undef HAVE_HOST_CPU_goldmont */
/* #undef HAVE_HOST_CPU_k8 */
/* #undef HAVE_HOST_CPU_k10 */
/* #undef HAVE_HOST_CPU_bulldozer */
/* #undef HAVE_HOST_CPU_piledriver */
/* #undef HAVE_HOST_CPU_steamroller */
/* #undef HAVE_HOST_CPU_excavator */
/* #undef HAVE_HOST_CPU_zen */
/* #undef HAVE_HOST_CPU_bobcat */
/* #undef HAVE_HOST_CPU_jaguar */
/* #undef HAVE_HOST_CPU_s390_z900 */
/* #undef HAVE_HOST_CPU_s390_z990 */
/* #undef HAVE_HOST_CPU_s390_z9 */
/* #undef HAVE_HOST_CPU_s390_z10 */
/* #undef HAVE_HOST_CPU_s390_z196 */
/* Define to 1 iff we have a s390 with 64-bit registers. */
/* #undef HAVE_HOST_CPU_s390_zarch */
/* Define to 1 if the system has the type `intmax_t'. */
#define HAVE_INTMAX_T 1
/* Define to 1 if the system has the type `intptr_t'. */
#define HAVE_INTPTR_T 1
/* Define to 1 if you have the <inttypes.h> header file. */
#define HAVE_INTTYPES_H 1
/* Define to 1 if you have the <invent.h> header file. */
/* #undef HAVE_INVENT_H */
/* Define to 1 if you have the <langinfo.h> header file. */
/* #undef HAVE_LANGINFO_H */
/* Define one of these to 1 for the endianness of `mp_limb_t'.
If the endianness is not a simple big or little, or you don't know what
it is, then leave both undefined. */
/* #undef HAVE_LIMB_BIG_ENDIAN */
#define HAVE_LIMB_LITTLE_ENDIAN 1
/* Define to 1 if you have the `localeconv' function. */
#define HAVE_LOCALECONV 1
/* Define to 1 if you have the <locale.h> header file. */
#define HAVE_LOCALE_H 1
/* Define to 1 if the system has the type `long double'. */
#define HAVE_LONG_DOUBLE 1
/* Define to 1 if the system has the type `long long'. */
#define HAVE_LONG_LONG 1
/* Define to 1 if you have the <machine/hal_sysinfo.h> header file. */
/* #undef HAVE_MACHINE_HAL_SYSINFO_H */
/* Define to 1 if you have the <memory.h> header file. */
#define HAVE_MEMORY_H 1
/* Define to 1 if you have the `memset' function. */
#define HAVE_MEMSET 1
/* Define to 1 if you have the `mmap' function. */
/* #undef HAVE_MMAP */
/* Define to 1 if you have the `mprotect' function. */
#define HAVE_MPROTECT 1
/* Define to 1 each of the following for which a native (ie. CPU specific)
implementation of the corresponding routine exists. */
#define HAVE_NATIVE_mpn_add_n 1
/* #undef HAVE_NATIVE_mpn_add_n_sub_n */
#define HAVE_NATIVE_mpn_add_nc 1
/* #undef HAVE_NATIVE_mpn_addaddmul_1msb0 */
#define HAVE_NATIVE_mpn_addlsh1_n 1
#define HAVE_NATIVE_mpn_addlsh2_n 1
#define HAVE_NATIVE_mpn_addlsh_n 1
#define HAVE_NATIVE_mpn_addlsh1_nc 1
#define HAVE_NATIVE_mpn_addlsh2_nc 1
#define HAVE_NATIVE_mpn_addlsh_nc 1
/* #undef HAVE_NATIVE_mpn_addlsh1_n_ip1 */
/* #undef HAVE_NATIVE_mpn_addlsh2_n_ip1 */
/* #undef HAVE_NATIVE_mpn_addlsh_n_ip1 */
/* #undef HAVE_NATIVE_mpn_addlsh1_nc_ip1 */
/* #undef HAVE_NATIVE_mpn_addlsh2_nc_ip1 */
/* #undef HAVE_NATIVE_mpn_addlsh_nc_ip1 */
/* #undef HAVE_NATIVE_mpn_addlsh1_n_ip2 */
/* #undef HAVE_NATIVE_mpn_addlsh2_n_ip2 */
/* #undef HAVE_NATIVE_mpn_addlsh_n_ip2 */
/* #undef HAVE_NATIVE_mpn_addlsh1_nc_ip2 */
/* #undef HAVE_NATIVE_mpn_addlsh2_nc_ip2 */
/* #undef HAVE_NATIVE_mpn_addlsh_nc_ip2 */
/* #undef HAVE_NATIVE_mpn_addmul_1c */
#define HAVE_NATIVE_mpn_addmul_2 1
/* #undef HAVE_NATIVE_mpn_addmul_3 */
/* #undef HAVE_NATIVE_mpn_addmul_4 */
/* #undef HAVE_NATIVE_mpn_addmul_5 */
/* #undef HAVE_NATIVE_mpn_addmul_6 */
/* #undef HAVE_NATIVE_mpn_addmul_7 */
/* #undef HAVE_NATIVE_mpn_addmul_8 */
/* #undef HAVE_NATIVE_mpn_addmul_2s */
#define HAVE_NATIVE_mpn_and_n 1
#define HAVE_NATIVE_mpn_andn_n 1
#define HAVE_NATIVE_mpn_bdiv_dbm1c 1
#define HAVE_NATIVE_mpn_bdiv_q_1 1
#define HAVE_NATIVE_mpn_pi1_bdiv_q_1 1
#define HAVE_NATIVE_mpn_cnd_add_n 1
#define HAVE_NATIVE_mpn_cnd_sub_n 1
#define HAVE_NATIVE_mpn_com 1
#define HAVE_NATIVE_mpn_copyd 1
#define HAVE_NATIVE_mpn_copyi 1
/* #undef HAVE_NATIVE_mpn_div_qr_1n_pi1 */
/* #undef HAVE_NATIVE_mpn_div_qr_2 */
#define HAVE_NATIVE_mpn_divexact_1 1
/* #undef HAVE_NATIVE_mpn_divexact_by3c */
#define HAVE_NATIVE_mpn_divrem_1 1
/* #undef HAVE_NATIVE_mpn_divrem_1c */
#define HAVE_NATIVE_mpn_divrem_2 1
/* #undef HAVE_NATIVE_mpn_gcd_1 */
#define HAVE_NATIVE_mpn_gcd_11 1
/* #undef HAVE_NATIVE_mpn_gcd_22 */
#define HAVE_NATIVE_mpn_hamdist 1
#define HAVE_NATIVE_mpn_invert_limb 1
#define HAVE_NATIVE_mpn_ior_n 1
#define HAVE_NATIVE_mpn_iorn_n 1
#define HAVE_NATIVE_mpn_lshift 1
#define HAVE_NATIVE_mpn_lshiftc 1
/* #undef HAVE_NATIVE_mpn_lshsub_n */
/* #undef HAVE_NATIVE_mpn_mod_1 */
#define HAVE_NATIVE_mpn_mod_1_1p 1
/* #undef HAVE_NATIVE_mpn_mod_1c */
#define HAVE_NATIVE_mpn_mod_1s_2p 1
#define HAVE_NATIVE_mpn_mod_1s_4p 1
#define HAVE_NATIVE_mpn_mod_34lsub1 1
#define HAVE_NATIVE_mpn_modexact_1_odd 1
#define HAVE_NATIVE_mpn_modexact_1c_odd 1
#define HAVE_NATIVE_mpn_mul_1 1
#define HAVE_NATIVE_mpn_mul_1c 1
#define HAVE_NATIVE_mpn_mul_2 1
/* #undef HAVE_NATIVE_mpn_mul_3 */
/* #undef HAVE_NATIVE_mpn_mul_4 */
/* #undef HAVE_NATIVE_mpn_mul_5 */
/* #undef HAVE_NATIVE_mpn_mul_6 */
#define HAVE_NATIVE_mpn_mul_basecase 1
#define HAVE_NATIVE_mpn_mullo_basecase 1
#define HAVE_NATIVE_mpn_nand_n 1
#define HAVE_NATIVE_mpn_nior_n 1
#define HAVE_NATIVE_mpn_popcount 1
#define HAVE_NATIVE_mpn_preinv_divrem_1 1
/* #undef HAVE_NATIVE_mpn_preinv_mod_1 */
#define HAVE_NATIVE_mpn_redc_1 1
/* #undef HAVE_NATIVE_mpn_redc_2 */
#define HAVE_NATIVE_mpn_rsblsh1_n 1
#define HAVE_NATIVE_mpn_rsblsh2_n 1
#define HAVE_NATIVE_mpn_rsblsh_n 1
#define HAVE_NATIVE_mpn_rsblsh1_nc 1
/* #undef HAVE_NATIVE_mpn_rsblsh2_nc */
/* #undef HAVE_NATIVE_mpn_rsblsh_nc */
#define HAVE_NATIVE_mpn_rsh1add_n 1
#define HAVE_NATIVE_mpn_rsh1add_nc 1
#define HAVE_NATIVE_mpn_rsh1sub_n 1
#define HAVE_NATIVE_mpn_rsh1sub_nc 1
#define HAVE_NATIVE_mpn_rshift 1
/* #undef HAVE_NATIVE_mpn_sbpi1_bdiv_r */
#define HAVE_NATIVE_mpn_sqr_basecase 1
/* #undef HAVE_NATIVE_mpn_sqr_diagonal */
#define HAVE_NATIVE_mpn_sqr_diag_addlsh1 1
#define HAVE_NATIVE_mpn_sub_n 1
#define HAVE_NATIVE_mpn_sub_nc 1
#define HAVE_NATIVE_mpn_sublsh1_n 1
#define HAVE_NATIVE_mpn_sublsh2_n 1
/* #undef HAVE_NATIVE_mpn_sublsh_n */
/* #undef HAVE_NATIVE_mpn_sublsh1_nc */
/* #undef HAVE_NATIVE_mpn_sublsh2_nc */
/* #undef HAVE_NATIVE_mpn_sublsh_nc */
/* #undef HAVE_NATIVE_mpn_sublsh1_n_ip1 */
/* #undef HAVE_NATIVE_mpn_sublsh2_n_ip1 */
/* #undef HAVE_NATIVE_mpn_sublsh_n_ip1 */
/* #undef HAVE_NATIVE_mpn_sublsh1_nc_ip1 */
/* #undef HAVE_NATIVE_mpn_sublsh2_nc_ip1 */
/* #undef HAVE_NATIVE_mpn_sublsh_nc_ip1 */
/* #undef HAVE_NATIVE_mpn_submul_1c */
/* #undef HAVE_NATIVE_mpn_tabselect */
/* #undef HAVE_NATIVE_mpn_udiv_qrnnd */
/* #undef HAVE_NATIVE_mpn_udiv_qrnnd_r */
/* #undef HAVE_NATIVE_mpn_umul_ppmm */
/* #undef HAVE_NATIVE_mpn_umul_ppmm_r */
#define HAVE_NATIVE_mpn_xor_n 1
#define HAVE_NATIVE_mpn_xnor_n 1
/* Define to 1 if you have the `nl_langinfo' function. */
/* #undef HAVE_NL_LANGINFO */
/* Define to 1 if you have the <nl_types.h> header file. */
/* #undef HAVE_NL_TYPES_H */
/* Define to 1 if you have the `obstack_vprintf' function. */
/* #undef HAVE_OBSTACK_VPRINTF */
/* Define to 1 if you have the `popen' function. */
#define HAVE_POPEN 1
/* Define to 1 if you have the `processor_info' function. */
/* #undef HAVE_PROCESSOR_INFO */
/* Define to 1 if <sys/pstat.h> `struct pst_processor' exists and contains
`psp_iticksperclktick'. */
/* #undef HAVE_PSP_ITICKSPERCLKTICK */
/* Define to 1 if you have the `pstat_getprocessor' function. */
/* #undef HAVE_PSTAT_GETPROCESSOR */
/* Define to 1 if the system has the type `ptrdiff_t'. */
#define HAVE_PTRDIFF_T 1
/* Define to 1 if the system has the type `quad_t'. */
/* #undef HAVE_QUAD_T */
/* Define to 1 if you have the `raise' function. */
#define HAVE_RAISE 1
/* Define to 1 if you have the `read_real_time' function. */
/* #undef HAVE_READ_REAL_TIME */
/* Define to 1 if you have the `sigaction' function. */
/* #undef HAVE_SIGACTION */
/* Define to 1 if you have the `sigaltstack' function. */
/* #undef HAVE_SIGALTSTACK */
/* Define to 1 if you have the `sigstack' function. */
/* #undef HAVE_SIGSTACK */
/* Tune directory speed_cyclecounter, undef=none, 1=32bits, 2=64bits) */
#define HAVE_SPEED_CYCLECOUNTER 2
/* Define to 1 if you have the <sstream> header file. */
#define HAVE_SSTREAM 1
/* Define to 1 if the system has the type `stack_t'. */
/* #undef HAVE_STACK_T */
/* Define to 1 if you have the <stdint.h> header file. */
#define HAVE_STDINT_H 1
/* Define to 1 if you have the <stdlib.h> header file. */
#define HAVE_STDLIB_H 1
/* Define to 1 if the system has the type `std::locale'. */
#define HAVE_STD__LOCALE 1
/* Define to 1 if you have the `strchr' function. */
#define HAVE_STRCHR 1
/* Define to 1 if you have the `strerror' function. */
#define HAVE_STRERROR 1
/* Define to 1 if you have the <strings.h> header file. */
#define HAVE_STRINGS_H 1
/* Define to 1 if you have the <string.h> header file. */
#define HAVE_STRING_H 1
/* Define to 1 if you have the `strnlen' function. */
#define HAVE_STRNLEN 1
/* Define to 1 if you have the `strtol' function. */
#define HAVE_STRTOL 1
/* Define to 1 if you have the `strtoul' function. */
#define HAVE_STRTOUL 1
/* Define to 1 if you have the `sysconf' function. */
/* #undef HAVE_SYSCONF */
/* Define to 1 if you have the `sysctl' function. */
/* #undef HAVE_SYSCTL */
/* Define to 1 if you have the `sysctlbyname' function. */
/* #undef HAVE_SYSCTLBYNAME */
/* Define to 1 if you have the `syssgi' function. */
/* #undef HAVE_SYSSGI */
/* Define to 1 if you have the <sys/attributes.h> header file. */
/* #undef HAVE_SYS_ATTRIBUTES_H */
/* Define to 1 if you have the <sys/iograph.h> header file. */
/* #undef HAVE_SYS_IOGRAPH_H */
/* Define to 1 if you have the <sys/mman.h> header file. */
/* #undef HAVE_SYS_MMAN_H */
/* Define to 1 if you have the <sys/param.h> header file. */
#define HAVE_SYS_PARAM_H 1
/* Define to 1 if you have the <sys/processor.h> header file. */
/* #undef HAVE_SYS_PROCESSOR_H */
/* Define to 1 if you have the <sys/pstat.h> header file. */
/* #undef HAVE_SYS_PSTAT_H */
/* Define to 1 if you have the <sys/resource.h> header file. */
/* #undef HAVE_SYS_RESOURCE_H */
/* Define to 1 if you have the <sys/stat.h> header file. */
#define HAVE_SYS_STAT_H 1
/* Define to 1 if you have the <sys/sysctl.h> header file. */
/* #undef HAVE_SYS_SYSCTL_H */
/* Define to 1 if you have the <sys/sysinfo.h> header file. */
/* #undef HAVE_SYS_SYSINFO_H */
/* Define to 1 if you have the <sys/syssgi.h> header file. */
/* #undef HAVE_SYS_SYSSGI_H */
/* Define to 1 if you have the <sys/systemcfg.h> header file. */
/* #undef HAVE_SYS_SYSTEMCFG_H */
/* Define to 1 if you have the <sys/times.h> header file. */
/* #undef HAVE_SYS_TIMES_H */
/* Define to 1 if you have the <sys/time.h> header file. */
#define HAVE_SYS_TIME_H 1
/* Define to 1 if you have the <sys/types.h> header file. */
#define HAVE_SYS_TYPES_H 1
/* Define to 1 if you have the `times' function. */
/* #undef HAVE_TIMES */
/* Define to 1 if the system has the type `uint_least32_t'. */
#define HAVE_UINT_LEAST32_T 1
/* Define to 1 if you have the <unistd.h> header file. */
#define HAVE_UNISTD_H 1
/* Define to 1 if you have the `vsnprintf' function and it works properly. */
/* #undef HAVE_VSNPRINTF */
/* Define to 1 for Windos/64 */
#define HOST_DOS64 1
/* Assembler local label prefix */
#define LSYM_PREFIX "L"
/* Define to the sub-directory where libtool stores uninstalled libraries. */
#define LT_OBJDIR ".libs/"
/* Define to 1 to disable the use of inline assembly */
/* #undef NO_ASM */
/* Name of package */
#define PACKAGE "gmp"
/* Define to the address where bug reports for this package should be sent. */
#define PACKAGE_BUGREPORT "gmp-bugs@gmplib.org, see https://gmplib.org/manual/Reporting-Bugs.html"
/* Define to the full name of this package. */
#define PACKAGE_NAME "GNU MP"
/* Define to the full name and version of this package. */
#define PACKAGE_STRING "GNU MP 6.2.0"
/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "gmp"
/* Define to the home page for this package. */
#define PACKAGE_URL "http://www.gnu.org/software/gmp/"
/* Define to the version of this package. */
#define PACKAGE_VERSION "6.2.0"
/* Define as the return type of signal handlers (`int' or `void'). */
#define RETSIGTYPE void
/* The size of `mp_limb_t', as computed by sizeof. */
#define SIZEOF_MP_LIMB_T 8
/* The size of `unsigned', as computed by sizeof. */
#define SIZEOF_UNSIGNED 4
/* The size of `unsigned long', as computed by sizeof. */
#define SIZEOF_UNSIGNED_LONG 4
/* The size of `unsigned short', as computed by sizeof. */
#define SIZEOF_UNSIGNED_SHORT 2
/* The size of `void *', as computed by sizeof. */
#define SIZEOF_VOID_P 8
/* Define to 1 if sscanf requires writable inputs */
/* #undef SSCANF_WRITABLE_INPUT */
/* Define to 1 if you have the ANSI C header files. */
#define STDC_HEADERS 1
/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
#define TIME_WITH_SYS_TIME 1
/* Maximum size the tune program can test for SQR_TOOM2_THRESHOLD */
/* #undef TUNE_SQR_TOOM2_MAX */
/* Version number of package */
#define VERSION "6.2.0"
/* Define to 1 to enable ASSERT checking, per --enable-assert */
/* #undef WANT_ASSERT */
/* Define to 1 to enable GMP_CPU_TYPE faking cpuid, per --enable-fake-cpuid */
/* #undef WANT_FAKE_CPUID */
/* Define to 1 when building a fat binary. */
/* #undef WANT_FAT_BINARY */
/* Define to 1 to enable FFTs for multiplication, per --enable-fft */
#define WANT_FFT 1
/* Define to 1 to enable old mpn_mul_fft_full for multiplication, per
--enable-old-fft-full */
/* #undef WANT_OLD_FFT_FULL */
/* Define to 1 if --enable-profiling=gprof */
/* #undef WANT_PROFILING_GPROF */
/* Define to 1 if --enable-profiling=instrument */
/* #undef WANT_PROFILING_INSTRUMENT */
/* Define to 1 if --enable-profiling=prof */
/* #undef WANT_PROFILING_PROF */
/* Define one of these to 1 for the desired temporary memory allocation
method, per --enable-alloca. */
#define WANT_TMP_ALLOCA 1
/* #undef WANT_TMP_REENTRANT */
/* #undef WANT_TMP_NOTREENTRANT */
/* #undef WANT_TMP_DEBUG */
/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
significant byte first (like Motorola and SPARC, unlike Intel). */
#if defined AC_APPLE_UNIVERSAL_BUILD
# if defined __BIG_ENDIAN__
# define WORDS_BIGENDIAN 1
# endif
#else
# ifndef WORDS_BIGENDIAN
/* # undef WORDS_BIGENDIAN */
# endif
#endif
/* Define to 1 if the assembler understands the mulx instruction */
/* #undef X86_ASM_MULX */
/* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a
`char[]'. */
/* #undef YYTEXT_POINTER */
/* Define to `__inline__' or `__inline' if that's what the C compiler
calls it, or to nothing if 'inline' is not supported under any name. */
#ifndef __cplusplus
/* #undef inline */
#endif
/* Define to the equivalent of the C99 'restrict' keyword, or to
nothing if this is not supported. Do not define if restrict is
supported directly. */
#define restrict __restrict
/* Work around a bug in Sun C++: it does not support _Restrict or
__restrict__, even though the corresponding Sun C compiler ends up with
"#define restrict _Restrict" or "#define restrict __restrict__" in the
previous line. Perhaps some future version of Sun C++ will work with
restrict; if so, hopefully it defines __RESTRICT like Sun C does. */
#if defined __SUNPRO_CC && !defined __RESTRICT
# define _Restrict
# define __restrict__
#endif
/* Define to empty if the keyword `volatile' does not work. Warning: valid
code using `volatile' can become incorrect without. Disable with care. */
/* #undef volatile */

View File

@@ -1,11 +0,0 @@
--- UserMacros.cmake
+++ UserMacros.cmake
@@ -16,6 +16,8 @@
if (BUILD_USER_DEFINED_LIBS)
MACRO_USER_DEFINED_LIBS ()
endif (BUILD_USER_DEFINED_LIBS)
+
+include(Config/cmake/usermacros/windows_mt.cmake)
#-----------------------------------------------------------------------------
#------------------- E X A M P L E E N D -----------------------------------
#-----------------------------------------------------------------------------

View File

@@ -19,16 +19,16 @@ diff -Naur orig/CMakeLists.txt external_ispc/CMakeLists.txt
target_include_directories(${PROJECT_NAME} PRIVATE
- ${LLVM_INCLUDE_DIRS}
+ ${LLVM_INCLUDE_DIRS} ${CLANG_INCLUDE_DIRS}
${GENX_DEPS_DIR}/include
${CMAKE_CURRENT_SOURCE_DIR}/src
${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR})
# Compile options
diff -Naur orig/cmake/GenerateBuiltins.cmake.txt external_ispc/cmake/GenerateBuiltins.cmake.txt
+++ orig/cmake/GenerateBuiltins.cmake 2020-05-25 13:32:40.830803821 +0200
+++ external_ispc/cmake/GenerateBuiltins.cmake 2020-05-25 13:32:40.830803821 +0200
@@ -97,6 +97,8 @@
if ("${bit}" STREQUAL "32" AND ${arch} STREQUAL "x86")
set(target_arch "i386")
set(target_arch "i686")
+ # Blender: disable 32bit due to build issues on Linux and being unnecessary.
+ set(SKIP ON)
elseif ("${bit}" STREQUAL "64" AND ${arch} STREQUAL "x86")

View File

@@ -0,0 +1,27 @@
diff --git a/numpy/distutils/system_info.py b/numpy/distutils/system_info.py
index ba2b1f4..b10f7df 100644
--- a/numpy/distutils/system_info.py
+++ b/numpy/distutils/system_info.py
@@ -2164,8 +2164,8 @@ class accelerate_info(system_info):
'accelerate' in libraries):
if intel:
args.extend(['-msse3'])
- else:
- args.extend(['-faltivec'])
+# else:
+# args.extend(['-faltivec'])
args.extend([
'-I/System/Library/Frameworks/vecLib.framework/Headers'])
link_args.extend(['-Wl,-framework', '-Wl,Accelerate'])
@@ -2174,8 +2174,8 @@ class accelerate_info(system_info):
'veclib' in libraries):
if intel:
args.extend(['-msse3'])
- else:
- args.extend(['-faltivec'])
+# else:
+# args.extend(['-faltivec'])
args.extend([
'-I/System/Library/Frameworks/vecLib.framework/Headers'])
link_args.extend(['-Wl,-framework', '-Wl,vecLib'])

View File

@@ -86,3 +86,47 @@ index 1f9a3ee..d151e9a 100644
return isnan( value );
#else
return std::isnan(value);
diff --git a/DAEValidator/library/src/Dae.cpp b/DAEValidator/library/src/Dae.cpp
index 9256ee1..241ad67 100644
--- a/DAEValidator/library/src/Dae.cpp
+++ b/DAEValidator/library/src/Dae.cpp
@@ -304,7 +304,7 @@ namespace opencollada
if (auto root_node = root())
{
const auto & nodes = root_node.selectNodes("//*[@id]");
- for (const auto & node : nodes)
+ for (const auto node : nodes)
{
string id = node.attribute("id").value();
mIdCache.insert(id);
@@ -312,4 +312,4 @@ namespace opencollada
}
}
}
-}
\ No newline at end of file
+}
diff --git a/DAEValidator/library/src/DaeValidator.cpp b/DAEValidator/library/src/DaeValidator.cpp
index 715d903..24423ce 100644
--- a/DAEValidator/library/src/DaeValidator.cpp
+++ b/DAEValidator/library/src/DaeValidator.cpp
@@ -162,7 +162,7 @@ namespace opencollada
// Find xsi:schemaLocation attributes in dae and try to validate against specified xsd documents
const auto & elements = dae.root().selectNodes("//*[@xsi:schemaLocation]");
- for (const auto & element : elements)
+ for (const auto element : elements)
{
if (auto schemaLocation = element.attribute("schemaLocation"))
{
@@ -274,7 +274,7 @@ namespace opencollada
int result = 0;
map<string, size_t> ids;
const auto & nodes = dae.root().selectNodes("//*[@id]");
- for (const auto & node : nodes)
+ for (const auto node : nodes)
{
string id = node.attribute("id").value();
size_t line = node.line();

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

@@ -0,0 +1,23 @@
diff --git a/runtime/src/z_Linux_asm.S b/runtime/src/z_Linux_asm.S
index 0d8885e..42aa5ad 100644
--- a/runtime/src/z_Linux_asm.S
+++ b/runtime/src/z_Linux_asm.S
@@ -1540,10 +1540,12 @@ __kmp_unnamed_critical_addr:
.comm .gomp_critical_user_,32,8
.data
.align 8
- .global __kmp_unnamed_critical_addr
-__kmp_unnamed_critical_addr:
+ .global ___kmp_unnamed_critical_addr
+___kmp_unnamed_critical_addr:
.8byte .gomp_critical_user_
- .size __kmp_unnamed_critical_addr,8
+# if !(KMP_OS_DARWIN)
+ .size ___kmp_unnamed_critical_addr,8
+# endif
#endif /* KMP_ARCH_PPC64 || KMP_ARCH_AARCH64 */
#if KMP_OS_LINUX

View File

@@ -1,6 +1,6 @@
diff -Naur orig/cmake/FindIlmBase.cmake openvdb/cmake/FindIlmBase.cmake
--- orig/cmake/FindIlmBase.cmake 2019-12-06 13:11:33 -0700
+++ openvdb/cmake/FindIlmBase.cmake 2020-01-16 09:06:32 -0700
--- 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"
@@ -15,8 +15,8 @@ diff -Naur orig/cmake/FindIlmBase.cmake openvdb/cmake/FindIlmBase.cmake
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 13:11:33 -0700
+++ openvdb/cmake/FindOpenEXR.cmake 2020-01-16 09:06:39 -0700
--- 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"
@@ -31,9 +31,20 @@ diff -Naur orig/cmake/FindOpenEXR.cmake openvdb/cmake/FindOpenEXR.cmake
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 13:11:33 -0700
+++ openvdb/openvdb/CMakeLists.txt 2020-01-16 08:56:25 -0700
@@ -193,11 +193,12 @@
--- 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 @@
# 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()
@@ -41,33 +52,69 @@ diff -Naur orig/openvdb/CMakeLists.txt openvdb/openvdb/CMakeLists.txt
endif()
# @todo Should be target definitions
if(WIN32)
- add_definitions(-D_WIN32 -DNOMINMAX -DOPENVDB_DLL)
+ add_definitions(-D_WIN32 -DNOMINMAX -DOPENVDB_STATICLIB)
@@ -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()
##### Core library configuration
diff -Naur orig/openvdb/cmd/CMakeLists.txt openvdb/openvdb/cmd/CMakeLists.txt
--- orig/openvdb/cmd/CMakeLists.txt 2019-12-06 13:11:33 -0700
+++ openvdb/openvdb/cmd/CMakeLists.txt 2020-01-16 08:56:25 -0700
@@ -53,7 +53,7 @@
endif()
if(WIN32)
- add_definitions(-D_WIN32 -DNOMINMAX -DOPENVDB_DLL)
+ add_definitions(-D_WIN32 -DNOMINMAX -DOPENVDB_STATICLIB)
endif()
# rpath handling
diff -Naur orig/openvdb/unittest/CMakeLists.txt openvdb/openvdb/unittest/CMakeLists.txt
--- orig/openvdb/unittest/CMakeLists.txt 2019-12-06 13:11:33 -0700
+++ openvdb/openvdb/unittest/CMakeLists.txt 2020-01-16 08:56:25 -0700
@@ -49,7 +49,7 @@
endif()
if(WIN32)
- add_definitions(-D_WIN32 -DNOMINMAX -DOPENVDB_DLL)
+ add_definitions(-D_WIN32 -DNOMINMAX -DOPENVDB_STATICLIB)
endif()
##### VDB unit tests
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
@@ -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

View File

@@ -0,0 +1,289 @@
diff -ru a/Doc/library/ctypes.rst b/Doc/library/ctypes.rst
--- a/Doc/library/ctypes.rst 2020-03-10 07:11:12.000000000 +0100
+++ b/Doc/library/ctypes.rst 2020-07-14 08:10:10.000000000 +0200
@@ -1551,6 +1551,13 @@
value usable as argument (integer, string, ctypes instance). This allows
defining adapters that can adapt custom objects as function parameters.
+ .. attribute:: variadic
+
+ Assign a boolean to specify that the function takes a variable number of
+ arguments. This does not matter on most platforms, but for Apple arm64
+ platforms variadic functions have a different calling convention than
+ normal functions.
+
.. attribute:: errcheck
Assign a Python function or another callable to this attribute. The
diff -ru a/Modules/_ctypes/_ctypes.c b/Modules/_ctypes/_ctypes.c
--- a/Modules/_ctypes/_ctypes.c 2020-03-10 07:11:12.000000000 +0100
+++ b/Modules/_ctypes/_ctypes.c 2020-07-14 08:14:41.000000000 +0200
@@ -3175,6 +3175,35 @@
}
static int
+PyCFuncPtr_set_variadic(PyCFuncPtrObject *self, PyObject *ob, void *Py_UNUSED(ignored))
+{
+ StgDictObject *dict = PyObject_stgdict((PyObject *)self);
+ assert(dict);
+ int r = PyObject_IsTrue(ob);
+ if (r == 1) {
+ dict->flags |= FUNCFLAG_VARIADIC;
+ return 0;
+ } else if (r == 0) {
+ dict->flags &= ~FUNCFLAG_VARIADIC;
+ return 0;
+ } else {
+ return -1;
+ }
+}
+
+static PyObject *
+PyCFuncPtr_get_variadic(PyCFuncPtrObject *self, void *Py_UNUSED(ignored))
+{
+ StgDictObject *dict = PyObject_stgdict((PyObject *)self);
+ assert(dict); /* Cannot be NULL for PyCFuncPtrObject instances */
+ if (dict->flags & FUNCFLAG_VARIADIC)
+ Py_RETURN_TRUE;
+ else
+ Py_RETURN_FALSE;
+}
+
+
+static int
PyCFuncPtr_set_argtypes(PyCFuncPtrObject *self, PyObject *ob, void *Py_UNUSED(ignored))
{
PyObject *converters;
@@ -5632,6 +5661,7 @@
PyModule_AddObject(m, "FUNCFLAG_USE_ERRNO", PyLong_FromLong(FUNCFLAG_USE_ERRNO));
PyModule_AddObject(m, "FUNCFLAG_USE_LASTERROR", PyLong_FromLong(FUNCFLAG_USE_LASTERROR));
PyModule_AddObject(m, "FUNCFLAG_PYTHONAPI", PyLong_FromLong(FUNCFLAG_PYTHONAPI));
+ PyModule_AddObject(m, "FUNCFLAG_VARIADIC", PyLong_FromLong(FUNCFLAG_VARIADIC));
PyModule_AddStringConstant(m, "__version__", "1.1.0");
PyModule_AddObject(m, "_memmove_addr", PyLong_FromVoidPtr(memmove));
diff -ru a/Modules/_ctypes/callproc.c b/Modules/_ctypes/callproc.c
--- a/Modules/_ctypes/callproc.c 2020-03-10 07:11:12.000000000 +0100
+++ b/Modules/_ctypes/callproc.c 2020-07-14 08:18:33.000000000 +0200
@@ -767,7 +767,8 @@
ffi_type **atypes,
ffi_type *restype,
void *resmem,
- int argcount)
+ int argcount,
+ int argtypecount)
{
PyThreadState *_save = NULL; /* For Py_BLOCK_THREADS and Py_UNBLOCK_THREADS */
PyObject *error_object = NULL;
@@ -793,15 +794,38 @@
if ((flags & FUNCFLAG_CDECL) == 0)
cc = FFI_STDCALL;
#endif
- if (FFI_OK != ffi_prep_cif(&cif,
- cc,
- argcount,
- restype,
- atypes)) {
- PyErr_SetString(PyExc_RuntimeError,
- "ffi_prep_cif failed");
- return -1;
- }
+#if HAVE_FFI_PREP_CIF_VAR
+ /* Everyone SHOULD set f.variadic=True on variadic function pointers, but
+ * lots of existing code will not. If there's at least one arg and more
+ * args are passed than are defined in the prototype, then it must be a
+ * variadic function. */
+ if ((flags & FUNCFLAG_VARIADIC) ||
+ (argtypecount != 0 && argcount > argtypecount))
+ {
+ if (FFI_OK != ffi_prep_cif_var(&cif,
+ cc,
+ argtypecount,
+ argcount,
+ restype,
+ atypes)) {
+ PyErr_SetString(PyExc_RuntimeError,
+ "ffi_prep_cif_var failed");
+ return -1;
+ }
+ } else {
+#endif
+ if (FFI_OK != ffi_prep_cif(&cif,
+ cc,
+ argcount,
+ restype,
+ atypes)) {
+ PyErr_SetString(PyExc_RuntimeError,
+ "ffi_prep_cif failed");
+ return -1;
+ }
+#if HAVE_FFI_PREP_CIF_VAR
+ }
+#endif
if (flags & (FUNCFLAG_USE_ERRNO | FUNCFLAG_USE_LASTERROR)) {
error_object = _ctypes_get_errobj(&space);
@@ -1185,9 +1209,8 @@
if (-1 == _call_function_pointer(flags, pProc, avalues, atypes,
rtype, resbuf,
- Py_SAFE_DOWNCAST(argcount,
- Py_ssize_t,
- int)))
+ Py_SAFE_DOWNCAST(argcount, Py_ssize_t, int),
+ Py_SAFE_DOWNCAST(argtype_count, Py_ssize_t, int)))
goto cleanup;
#ifdef WORDS_BIGENDIAN
diff -ru a/Modules/_ctypes/ctypes.h b/Modules/_ctypes/ctypes.h
--- a/Modules/_ctypes/ctypes.h 2020-03-10 07:11:12.000000000 +0100
+++ b/Modules/_ctypes/ctypes.h 2020-07-14 08:30:53.000000000 +0200
@@ -285,6 +285,7 @@
#define FUNCFLAG_PYTHONAPI 0x4
#define FUNCFLAG_USE_ERRNO 0x8
#define FUNCFLAG_USE_LASTERROR 0x10
+#define FUNCFLAG_VARIADIC 0x20
#define TYPEFLAG_ISPOINTER 0x100
#define TYPEFLAG_HASPOINTER 0x200
diff -ru a/configure b/configure
--- a/configure 2020-03-10 07:11:12.000000000 +0100
+++ b/configure 2020-07-14 08:03:27.000000000 +0200
@@ -3374,7 +3374,7 @@
# has no effect, don't bother defining them
Darwin/[6789].*)
define_xopen_source=no;;
- Darwin/1[0-9].*)
+ Darwin/[12][0-9].*)
define_xopen_source=no;;
# On AIX 4 and 5.1, mbstate_t is defined only when _XOPEN_SOURCE == 500 but
# used in wcsnrtombs() and mbsnrtowcs() even if _XOPEN_SOURCE is not defined
@@ -9251,6 +9251,9 @@
ppc)
MACOSX_DEFAULT_ARCH="ppc64"
;;
+ arm64)
+ MACOSX_DEFAULT_ARCH="arm64"
+ ;;
*)
as_fn_error $? "Unexpected output of 'arch' on OSX" "$LINENO" 5
;;
diff -ru a/configure.ac b/configure.ac
--- a/configure.ac 2020-03-10 07:11:12.000000000 +0100
+++ b/configure.ac 2020-07-14 08:03:27.000000000 +0200
@@ -2456,6 +2456,9 @@
ppc)
MACOSX_DEFAULT_ARCH="ppc64"
;;
+ arm64)
+ MACOSX_DEFAULT_ARCH="arm64"
+ ;;
*)
AC_MSG_ERROR([Unexpected output of 'arch' on OSX])
;;
diff -ru a/setup.py b/setup.py
--- a/setup.py 2020-03-10 07:11:12.000000000 +0100
+++ b/setup.py 2020-07-14 08:28:12.000000000 +0200
@@ -141,6 +141,13 @@
os.unlink(tmpfile)
return MACOS_SDK_ROOT
+
+def is_macosx_at_least(vers):
+ if host_platform == 'darwin':
+ dep_target = sysconfig.get_config_var('MACOSX_DEPLOYMENT_TARGET')
+ if dep_target:
+ return tuple(map(int, dep_target.split('.'))) >= vers
+ return False
def is_macosx_sdk_path(path):
"""
@@ -150,6 +157,13 @@
or path.startswith('/System/')
or path.startswith('/Library/') )
+def grep_headers_for(function, headers):
+ for header in headers:
+ with open(header, 'r') as f:
+ if function in f.read():
+ return True
+ return False
+
def find_file(filename, std_dirs, paths):
"""Searches for the directory where a given file is located,
and returns a possibly-empty list of additional directories, or None
@@ -1972,7 +1986,11 @@
return True
def detect_ctypes(self, inc_dirs, lib_dirs):
- self.use_system_libffi = False
+ if not sysconfig.get_config_var("LIBFFI_INCLUDEDIR") and is_macosx_at_least((10,15)):
+ self.use_system_libffi = True
+ else:
+ self.use_system_libffi = '--with-system-ffi' in sysconfig.get_config_var("CONFIG_ARGS")
+
include_dirs = []
extra_compile_args = []
extra_link_args = []
@@ -2016,32 +2034,48 @@
ext_test = Extension('_ctypes_test',
sources=['_ctypes/_ctypes_test.c'],
libraries=['m'])
+ ffi_inc = sysconfig.get_config_var("LIBFFI_INCLUDEDIR")
+ ffi_lib = None
+
self.extensions.extend([ext, ext_test])
if host_platform == 'darwin':
- if '--with-system-ffi' not in sysconfig.get_config_var("CONFIG_ARGS"):
+ if not self.use_system_libffi:
return
- # OS X 10.5 comes with libffi.dylib; the include files are
- # in /usr/include/ffi
- inc_dirs.append('/usr/include/ffi')
-
- ffi_inc = [sysconfig.get_config_var("LIBFFI_INCLUDEDIR")]
- if not ffi_inc or ffi_inc[0] == '':
- ffi_inc = find_file('ffi.h', [], inc_dirs)
- if ffi_inc is not None:
- ffi_h = ffi_inc[0] + '/ffi.h'
+ ffi_in_sdk = os.path.join(macosx_sdk_root(), "usr/include/ffi")
+ if os.path.exists(ffi_in_sdk):
+ ffi_inc = ffi_in_sdk
+ ffi_lib = 'ffi'
+ else:
+ # OS X 10.5 comes with libffi.dylib; the include files are
+ # in /usr/include/ffi
+ ffi_inc_dirs.append('/usr/include/ffi')
+
+ if not ffi_inc:
+ found = find_file('ffi.h', [], ffi_inc_dirs)
+ if found:
+ ffi_inc = found[0]
+ if ffi_inc:
+ ffi_h = ffi_inc + '/ffi.h'
if not os.path.exists(ffi_h):
ffi_inc = None
print('Header file {} does not exist'.format(ffi_h))
- ffi_lib = None
- if ffi_inc is not None:
+ if ffi_lib is None and ffi_inc:
for lib_name in ('ffi', 'ffi_pic'):
if (self.compiler.find_library_file(lib_dirs, lib_name)):
ffi_lib = lib_name
break
if ffi_inc and ffi_lib:
- ext.include_dirs.extend(ffi_inc)
+ ffi_headers = glob(os.path.join(ffi_inc, '*.h'))
+ if grep_headers_for('ffi_closure_alloc', ffi_headers):
+ try:
+ sources.remove('_ctypes/malloc_closure.c')
+ except ValueError:
+ pass
+ if grep_headers_for('ffi_prep_cif_var', ffi_headers):
+ ext.extra_compile_args.append("-DHAVE_FFI_PREP_CIF_VAR=1")
+ ext.include_dirs.append(ffi_inc)
ext.libraries.append(ffi_lib)
self.use_system_libffi = True

View File

@@ -0,0 +1,14 @@
Only in external_sqlite_orig: config.log
diff -ru external_sqlite_orig/config.sub external_sqlite/config.sub
--- external_sqlite_orig/config.sub 2020-07-10 14:06:42.000000000 +0200
+++ external_sqlite/config.sub 2020-07-10 14:10:24.000000000 +0200
@@ -314,6 +314,7 @@
# Recognize the basic CPU types with company name.
580-* \
| a29k-* \
+ | aarch64-* \
| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
| alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
Only in external_sqlite: mksourceid
Only in external_sqlite: sqlite3session.h

View File

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

View File

@@ -10,77 +10,6 @@ diff -x .git -ur usd.orig/cmake/defaults/Packages.cmake external_usd/cmake/defau
add_definitions(${TBB_DEFINITIONS})
# --math
diff -x .git -ur usd.orig/pxr/base/plug/initConfig.cpp external_usd/pxr/base/plug/initConfig.cpp
--- usd.orig/pxr/base/plug/initConfig.cpp.orig 2020-06-12 17:20:07.478199779 +0200
+++ external_usd/pxr/base/plug/initConfig.cpp 2020-06-12 17:25:28.648588552 +0200
@@ -69,10 +69,40 @@
ARCH_CONSTRUCTOR(Plug_InitConfig, 2, void)
{
+ /* The contents of this constructor have been moved to usd_initialise_plugin_path(...) */
+}
+
+}; // end of anonymous namespace
+
+/**
+ * The contents of this function used to be in the static constructor Plug_InitConfig.
+ * This static constructor made it impossible for Blender to pass a path to the USD
+ * library at runtime, as the constructor would run before Blender's main() function.
+ *
+ * This function is wrapped in a C function of the same name (defined below),
+ * so that it can be called from Blender's main() function.
+ *
+ * The datafiles_usd_path path is used to point to the USD plugin path when Blender
+ * has been installed. The fallback_usd_path path should point to the build-time
+ * location of the USD plugin files so that Blender can be run on a development machine
+ * without requiring an installation step.
+ */
+void
+usd_initialise_plugin_path(const char *datafiles_usd_path)
+{
std::vector<std::string> result;
std::vector<std::string> debugMessages;
+ // Add Blender-specific paths. They MUST end in a slash, or symlinks will not be treated as directory.
+ if (datafiles_usd_path != NULL && datafiles_usd_path[0] != '\0') {
+ std::string datafiles_usd_path_str(datafiles_usd_path);
+ if (datafiles_usd_path_str.back() != '/') {
+ datafiles_usd_path_str += "/";
+ }
+ result.push_back(datafiles_usd_path_str);
+ }
+
// Determine the absolute path to the Plug shared library. Any relative
// paths specified in the plugin search path will be anchored to this
// directory, to allow for relocatability. Note that this can fail when pxr
@@ -114,9 +144,24 @@
_AppendPathList(&result, installLocation, binaryPath);
#endif // PXR_INSTALL_LOCATION
- Plug_SetPaths(result, debugMessages);
-}
+ if (!TfGetenv("PXR_PATH_DEBUG").empty()) {
+ printf("USD Plugin paths: (%zu in total):\n", result.size());
+ for(const std::string &path : result) {
+ printf(" %s\n", path.c_str());
+ }
+ }
+ Plug_SetPaths(result, debugMessages);
}
PXR_NAMESPACE_CLOSE_SCOPE
+
+/* Workaround to make it possible to pass a path at runtime to USD. */
+extern "C" {
+void
+usd_initialise_plugin_path(
+ const char *datafiles_usd_path)
+{
+ PXR_NS::usd_initialise_plugin_path(datafiles_usd_path);
+}
+}
diff -Naur external_usd_base/cmake/macros/Public.cmake external_usd/cmake/macros/Public.cmake
--- external_usd_base/cmake/macros/Public.cmake 2019-10-24 14:39:53 -0600
+++ external_usd/cmake/macros/Public.cmake 2020-01-11 13:33:29 -0700
@@ -97,3 +26,36 @@ diff -Naur external_usd_base/cmake/macros/Public.cmake external_usd/cmake/macros
endforeach()
foreach(lib ${PXR_OBJECT_LIBS})
set(objects "${objects};\$<TARGET_OBJECTS:${lib}>")
diff --git a/pxr/base/arch/align.h b/pxr/base/arch/align.h
index f3cabf4..ebc8a69 100644
--- a/pxr/base/arch/align.h
+++ b/pxr/base/arch/align.h
@@ -77,7 +77,11 @@ ArchAlignMemory(void *base)
/// The size of a CPU cache line on the current processor architecture in bytes.
///
/// \hideinitializer
+#if defined(ARCH_OS_DARWIN) && defined(ARCH_CPU_ARM)
+#define ARCH_CACHE_LINE_SIZE 128
+#else
#define ARCH_CACHE_LINE_SIZE 64
+#endif
///@}
diff --git a/pxr/base/arch/math.h b/pxr/base/arch/math.h
index 3e66c37..64a052c 100644
--- a/pxr/base/arch/math.h
+++ b/pxr/base/arch/math.h
@@ -42,7 +42,7 @@ PXR_NAMESPACE_OPEN_SCOPE
/// \addtogroup group_arch_Math
///@{
-#if defined (ARCH_CPU_INTEL) || defined(doxygen)
+#if defined (ARCH_CPU_INTEL) || defined(ARCH_CPU_ARM) || defined(doxygen)
/// This is the smallest value e such that 1+e^2 == 1, using floats.
/// True for all IEEE754 chipsets.

View File

@@ -24,6 +24,7 @@ import re
import subprocess
import sys
def is_tool(name):
"""Check whether `name` is on PATH and marked as executable."""
@@ -32,11 +33,13 @@ def is_tool(name):
return which(name) is not None
class Builder:
def __init__(self, name, branch):
def __init__(self, name, branch, codesign):
self.name = name
self.branch = branch
self.is_release_branch = re.match("^blender-v(.*)-release$", branch) is not None
self.codesign = codesign
# Buildbot runs from build/ directory
self.blender_dir = os.path.abspath(os.path.join('..', 'blender.git'))
@@ -47,28 +50,30 @@ class Builder:
# Detect platform
if name.startswith('mac'):
self.platform = 'mac'
self.command_prefix = []
self.command_prefix = []
elif name.startswith('linux'):
self.platform = 'linux'
if is_tool('scl'):
self.command_prefix = ['scl', 'enable', 'devtoolset-9', '--']
self.command_prefix = ['scl', 'enable', 'devtoolset-9', '--']
else:
self.command_prefix = []
self.command_prefix = []
elif name.startswith('win'):
self.platform = 'win'
self.command_prefix = []
self.command_prefix = []
else:
raise ValueError('Unkonw platform for builder ' + self.platform)
# Always 64 bit now
self.bits = 64
def create_builder_from_arguments():
parser = argparse.ArgumentParser()
parser.add_argument('builder_name')
parser.add_argument('branch', default='master', nargs='?')
parser.add_argument("--codesign", action="store_true")
args = parser.parse_args()
return Builder(args.builder_name, args.branch)
return Builder(args.builder_name, args.branch, args.codesign)
class VersionInfo:
@@ -102,7 +107,7 @@ class VersionInfo:
def _parse_header_file(self, filename, define):
import re
regex = re.compile("^#\s*define\s+%s\s+(.*)" % define)
regex = re.compile(r"^#\s*define\s+%s\s+(.*)" % define)
with open(filename, "r") as file:
for l in file:
match = regex.match(l)

View File

@@ -18,12 +18,72 @@
# <pep8 compliant>
import dataclasses
import json
import os
from pathlib import Path
from typing import Optional
import codesign.util as util
class ArchiveStateError(Exception):
message: str
def __init__(self, message):
self.message = message
super().__init__(self.message)
@dataclasses.dataclass
class ArchiveState:
"""
Additional information (state) of the archive
Includes information like expected file size of the archive file in the case
the archive file is expected to be successfully created.
If the archive can not be created, this state will contain error message
indicating details of error.
"""
# Size in bytes of the corresponding archive.
file_size: Optional[int] = None
# Non-empty value indicates that error has happenned.
error_message: str = ''
def has_error(self) -> bool:
"""
Check whether the archive is at error state
"""
return self.error_message
def serialize_to_string(self) -> str:
payload = dataclasses.asdict(self)
return json.dumps(payload, sort_keys=True, indent=4)
def serialize_to_file(self, filepath: Path) -> None:
string = self.serialize_to_string()
filepath.write_text(string)
@classmethod
def deserialize_from_string(cls, string: str) -> 'ArchiveState':
try:
object_as_dict = json.loads(string)
except json.decoder.JSONDecodeError:
raise ArchiveStateError('Error parsing JSON')
return cls(**object_as_dict)
@classmethod
def deserialize_from_file(cls, filepath: Path):
string = filepath.read_text()
return cls.deserialize_from_string(string)
class ArchiveWithIndicator:
"""
The idea of this class is to wrap around logic which takes care of keeping
@@ -79,6 +139,19 @@ class ArchiveWithIndicator:
if not self.ready_indicator_filepath.exists():
return False
try:
archive_state = ArchiveState.deserialize_from_file(
self.ready_indicator_filepath)
except ArchiveStateError as error:
print(f'Error deserializing archive state: {error.message}')
return False
if archive_state.has_error():
# If the error did happen during codesign procedure there will be no
# corresponding archive file.
# The caller code will deal with the error check further.
return True
# Sometimes on macOS indicator file appears prior to the actual archive
# despite the order of creation and os.sync() used in tag_ready().
# So consider archive not ready if there is an indicator without an
@@ -88,23 +161,11 @@ class ArchiveWithIndicator:
f'({self.archive_filepath}) to appear.')
return False
# Read archive size from indicator/
#
# Assume that file is either empty or is fully written. This is being checked
# by performing ValueError check since empty string will throw this exception
# when attempted to be converted to int.
expected_archive_size_str = self.ready_indicator_filepath.read_text()
try:
expected_archive_size = int(expected_archive_size_str)
except ValueError:
print(f'Invalid archive size "{expected_archive_size_str}"')
return False
# Wait for until archive is fully stored.
actual_archive_size = self.archive_filepath.stat().st_size
if actual_archive_size != expected_archive_size:
if actual_archive_size != archive_state.file_size:
print('Partial/invalid archive size (expected '
f'{expected_archive_size} got {actual_archive_size})')
f'{archive_state.file_size} got {actual_archive_size})')
return False
return True
@@ -129,7 +190,7 @@ class ArchiveWithIndicator:
print(f'Exception checking archive: {e}')
return False
def tag_ready(self) -> None:
def tag_ready(self, error_message='') -> None:
"""
Tag the archive as ready by creating the corresponding indication file.
@@ -138,13 +199,34 @@ class ArchiveWithIndicator:
If it is violated, an assert will fail.
"""
assert not self.is_ready()
# Try the best to make sure everything is synced to the file system,
# to avoid any possibility of stamp appearing on a network share prior to
# an actual file.
if util.get_current_platform() != util.Platform.WINDOWS:
os.sync()
archive_size = self.archive_filepath.stat().st_size
self.ready_indicator_filepath.write_text(str(archive_size))
archive_size = -1
if self.archive_filepath.exists():
archive_size = self.archive_filepath.stat().st_size
archive_info = ArchiveState(
file_size=archive_size, error_message=error_message)
self.ready_indicator_filepath.write_text(
archive_info.serialize_to_string())
def get_state(self) -> ArchiveState:
"""
Get state object for this archive
The state is read from the corresponding state file.
"""
try:
return ArchiveState.deserialize_from_file(self.ready_indicator_filepath)
except ArchiveStateError as error:
return ArchiveState(error_message=f'Error in information format: {error}')
def clean(self) -> None:
"""

View File

@@ -58,6 +58,7 @@ import codesign.util as util
from codesign.absolute_and_relative_filename import AbsoluteAndRelativeFileName
from codesign.archive_with_indicator import ArchiveWithIndicator
from codesign.exception import CodeSignException
logger = logging.getLogger(__name__)
@@ -145,13 +146,13 @@ class BaseCodeSigner(metaclass=abc.ABCMeta):
def cleanup_environment_for_builder(self) -> None:
# TODO(sergey): Revisit need of cleaning up the existing files.
# In practice it wasn't so helpful, and with multiple clients
# talking to the same server it becomes even mor etricky.
# talking to the same server it becomes even more tricky.
pass
def cleanup_environment_for_signing_server(self) -> None:
# TODO(sergey): Revisit need of cleaning up the existing files.
# In practice it wasn't so helpful, and with multiple clients
# talking to the same server it becomes even mor etricky.
# talking to the same server it becomes even more tricky.
pass
def generate_request_id(self) -> str:
@@ -220,9 +221,15 @@ class BaseCodeSigner(metaclass=abc.ABCMeta):
"""
Wait until archive with signed files is available.
Will only return if the archive with signed files is available. If there
was an error during code sign procedure the SystemExit exception is
raised, with the message set to the error reported by the codesign
server.
Will only wait for the configured time. If that time exceeds and there
is still no responce from the signing server the application will exit
with a non-zero exit code.
"""
signed_archive_info = self.signed_archive_info_for_request_id(
@@ -236,9 +243,17 @@ class BaseCodeSigner(metaclass=abc.ABCMeta):
time.sleep(1)
time_slept_in_seconds = time.monotonic() - time_start
if time_slept_in_seconds > timeout_in_seconds:
signed_archive_info.clean()
unsigned_archive_info.clean()
raise SystemExit("Signing server didn't finish signing in "
f"{timeout_in_seconds} seconds, dying :(")
f'{timeout_in_seconds} seconds, dying :(')
archive_state = signed_archive_info.get_state()
if archive_state.has_error():
signed_archive_info.clean()
unsigned_archive_info.clean()
raise SystemExit(
f'Error happenned during codesign procedure: {archive_state.error_message}')
def copy_signed_files_to_directory(
self, signed_dir: Path, destination_dir: Path) -> None:
@@ -396,7 +411,13 @@ class BaseCodeSigner(metaclass=abc.ABCMeta):
temp_dir)
logger_server.info('Signing all requested files...')
self.sign_all_files(files)
try:
self.sign_all_files(files)
except CodeSignException as error:
signed_archive_info.tag_ready(error_message=error.message)
unsigned_archive_info.clean()
logger_server.info('Signing is complete with errors.')
return
logger_server.info('Packing signed files...')
pack_files(files=files,

View File

@@ -16,24 +16,11 @@
#
# ##### END GPL LICENSE BLOCK #####
import bpy
# <pep8 compliant>
class NewSimulation(bpy.types.Operator):
"""Create a new simulation data block and edit it in the opened simulation editor"""
class CodeSignException(Exception):
message: str
bl_idname = "simulation.new"
bl_label = "New Simulation"
bl_options = {'REGISTER', 'UNDO'}
@classmethod
def poll(cls, context):
return context.area.type == 'NODE_EDITOR' and context.space_data.tree_type == 'SimulationNodeTree'
def execute(self, context):
simulation = bpy.data.simulations.new("Simulation")
context.space_data.simulation = simulation
return {'FINISHED'}
classes = (
NewSimulation,
)
def __init__(self, message):
self.message = message
super().__init__(self.message)

View File

@@ -33,6 +33,7 @@ from buildbot_utils import Builder
from codesign.absolute_and_relative_filename import AbsoluteAndRelativeFileName
from codesign.base_code_signer import BaseCodeSigner
from codesign.exception import CodeSignException
logger = logging.getLogger(__name__)
logger_server = logger.getChild('server')
@@ -45,6 +46,10 @@ EXTENSIONS_TO_BE_SIGNED = {'.dylib', '.so', '.dmg'}
NAME_PREFIXES_TO_BE_SIGNED = {'python'}
class NotarizationException(CodeSignException):
pass
def is_file_from_bundle(file: AbsoluteAndRelativeFileName) -> bool:
"""
Check whether file is coming from an .app bundle
@@ -186,7 +191,7 @@ class MacOSCodeSigner(BaseCodeSigner):
file.absolute_filepath]
self.run_command_or_mock(command, util.Platform.MACOS)
def codesign_all_files(self, files: List[AbsoluteAndRelativeFileName]) -> bool:
def codesign_all_files(self, files: List[AbsoluteAndRelativeFileName]) -> None:
"""
Run codesign tool on all eligible files in the given list.
@@ -225,8 +230,6 @@ class MacOSCodeSigner(BaseCodeSigner):
file_index + 1, num_signed_files,
signed_file.relative_filepath)
return True
def codesign_bundles(
self, files: List[AbsoluteAndRelativeFileName]) -> None:
"""
@@ -273,8 +276,6 @@ class MacOSCodeSigner(BaseCodeSigner):
files.extend(extra_files)
return True
############################################################################
# Notarization.
@@ -334,7 +335,40 @@ class MacOSCodeSigner(BaseCodeSigner):
logger_server.error('xcrun command did not report RequestUUID')
return None
def notarize_wait_result(self, request_uuid: str) -> bool:
def notarize_review_status(self, xcrun_output: str) -> bool:
"""
Review status returned by xcrun's notarization info
Returns truth if the notarization process has finished.
If there are errors during notarization, a NotarizationException()
exception is thrown with status message from the notarial office.
"""
# Parse status and message
status = xcrun_field_value_from_output('Status', xcrun_output)
status_message = xcrun_field_value_from_output(
'Status Message', xcrun_output)
if status == 'success':
logger_server.info(
'Package successfully notarized: %s', status_message)
return True
if status == 'invalid':
logger_server.error(xcrun_output)
logger_server.error(
'Package notarization has failed: %s', status_message)
raise NotarizationException(status_message)
if status == 'in progress':
return False
logger_server.info(
'Unknown notarization status %s (%s)', status, status_message)
return False
def notarize_wait_result(self, request_uuid: str) -> None:
"""
Wait for until notarial office have a reply
"""
@@ -351,29 +385,11 @@ class MacOSCodeSigner(BaseCodeSigner):
timeout_in_seconds = self.config.MACOS_NOTARIZE_TIMEOUT_IN_SECONDS
while True:
output = self.check_output_or_mock(
xcrun_output = self.check_output_or_mock(
command, util.Platform.MACOS, allow_nonzero_exit_code=True)
# Parse status and message
status = xcrun_field_value_from_output('Status', output)
status_message = xcrun_field_value_from_output(
'Status Message', output)
# Review status.
if status:
if status == 'success':
logger_server.info(
'Package successfully notarized: %s', status_message)
return True
elif status == 'invalid':
logger_server.error(output)
logger_server.error(
'Package notarization has failed: %s', status_message)
return False
elif status == 'in progress':
pass
else:
logger_server.info(
'Unknown notarization status %s (%s)', status, status_message)
if self.notarize_review_status(xcrun_output):
break
logger_server.info('Keep waiting for notarization office.')
time.sleep(30)
@@ -394,8 +410,6 @@ class MacOSCodeSigner(BaseCodeSigner):
command = ['xcrun', 'stapler', 'staple', '-v', file.absolute_filepath]
self.check_output_or_mock(command, util.Platform.MACOS)
return True
def notarize_dmg(self, file: AbsoluteAndRelativeFileName) -> bool:
"""
Run entire pipeline to get DMG notarized.
@@ -414,10 +428,7 @@ class MacOSCodeSigner(BaseCodeSigner):
return False
# Staple.
if not self.notarize_staple(file):
return False
return True
self.notarize_staple(file)
def notarize_all_dmg(
self, files: List[AbsoluteAndRelativeFileName]) -> bool:
@@ -432,10 +443,7 @@ class MacOSCodeSigner(BaseCodeSigner):
if not self.check_file_is_to_be_signed(file):
continue
if not self.notarize_dmg(file):
return False
return True
self.notarize_dmg(file)
############################################################################
# Entry point.
@@ -443,11 +451,6 @@ class MacOSCodeSigner(BaseCodeSigner):
def sign_all_files(self, files: List[AbsoluteAndRelativeFileName]) -> None:
# TODO(sergey): Handle errors somehow.
if not self.codesign_all_files(files):
return
if not self.codesign_bundles(files):
return
if not self.notarize_all_dmg(files):
return
self.codesign_all_files(files)
self.codesign_bundles(files)
self.notarize_all_dmg(files)

View File

@@ -29,6 +29,7 @@ from buildbot_utils import Builder
from codesign.absolute_and_relative_filename import AbsoluteAndRelativeFileName
from codesign.base_code_signer import BaseCodeSigner
from codesign.exception import CodeSignException
logger = logging.getLogger(__name__)
logger_server = logger.getChild('server')
@@ -40,6 +41,9 @@ BLACKLIST_FILE_PREFIXES = (
'api-ms-', 'concrt', 'msvcp', 'ucrtbase', 'vcomp', 'vcruntime')
class SigntoolException(CodeSignException):
pass
class WindowsCodeSigner(BaseCodeSigner):
def check_file_is_to_be_signed(
self, file: AbsoluteAndRelativeFileName) -> bool:
@@ -50,12 +54,46 @@ class WindowsCodeSigner(BaseCodeSigner):
return file.relative_filepath.suffix in EXTENSIONS_TO_BE_SIGNED
def get_sign_command_prefix(self) -> List[str]:
return [
'signtool', 'sign', '/v',
'/f', self.config.WIN_CERTIFICATE_FILEPATH,
'/tr', self.config.WIN_TIMESTAMP_AUTHORITY_URL]
def run_codesign_tool(self, filepath: Path) -> None:
command = self.get_sign_command_prefix() + [filepath]
try:
codesign_output = self.check_output_or_mock(command, util.Platform.WINDOWS)
except subprocess.CalledProcessError as e:
raise SigntoolException(f'Error running signtool {e}')
logger_server.info(f'signtool output:\n{codesign_output}')
got_number_of_success = False
for line in codesign_output.split('\n'):
line_clean = line.strip()
line_clean_lower = line_clean.lower()
if line_clean_lower.startswith('number of warnings') or \
line_clean_lower.startswith('number of errors'):
number = int(line_clean_lower.split(':')[1])
if number != 0:
raise SigntoolException('Non-clean success of signtool')
if line_clean_lower.startswith('number of files successfully signed'):
got_number_of_success = True
number = int(line_clean_lower.split(':')[1])
if number != 1:
raise SigntoolException('Signtool did not consider codesign a success')
if not got_number_of_success:
raise SigntoolException('Signtool did not report number of files signed')
def sign_all_files(self, files: List[AbsoluteAndRelativeFileName]) -> None:
# NOTE: Sign files one by one to avoid possible command line length
# overflow (which could happen if we ever decide to sign every binary
@@ -73,12 +111,7 @@ class WindowsCodeSigner(BaseCodeSigner):
file_index + 1, num_files, file.relative_filepath)
continue
command = self.get_sign_command_prefix()
command.append(file.absolute_filepath)
logger_server.info(
'Running signtool command for file [%d/%d] %s...',
file_index + 1, num_files, file.relative_filepath)
# TODO(sergey): Check the status somehow. With a missing certificate
# the command still exists with a zero code.
self.run_command_or_mock(command, util.Platform.WINDOWS)
# TODO(sergey): Report number of signed and ignored files.
self.run_codesign_tool(file.absolute_filepath)

View File

@@ -82,6 +82,10 @@ def create_argument_parser():
type=Path,
help="Optional path to applescript to set up folder looks of DMG."
"If not provided default Blender's one is used.")
parser.add_argument(
'--codesign',
action="store_true",
help="Code sign and notarize DMG contents.")
return parser
@@ -395,7 +399,8 @@ def create_final_dmg(app_bundles: List[Path],
dmg_filepath: Path,
background_image_filepath: Path,
volume_name: str,
applescript: Path) -> None:
applescript: Path,
codesign: bool) -> None:
"""
Create DMG with all app bundles
@@ -421,7 +426,8 @@ def create_final_dmg(app_bundles: List[Path],
#
# This allows to recurs into the content of bundles without worrying about
# possible interfereice of Application symlink.
codesign_app_bundles_in_dmg(mount_directory)
if codesign:
codesign_app_bundles_in_dmg(mount_directory)
copy_background_if_needed(background_image_filepath, mount_directory)
create_applications_link(mount_directory)
@@ -434,7 +440,8 @@ def create_final_dmg(app_bundles: List[Path],
compress_dmg(writable_dmg_filepath, dmg_filepath)
writable_dmg_filepath.unlink()
codesign_and_notarize_dmg(dmg_filepath)
if codesign:
codesign_and_notarize_dmg(dmg_filepath)
def ensure_dmg_extension(filepath: Path) -> Path:
@@ -521,6 +528,7 @@ def main():
source_dir = args.source_dir.absolute()
background_image_filepath = get_background_image(args.background_image)
applescript = get_applescript(args.applescript)
codesign = args.codesign
app_bundles = collect_and_log_app_bundles(source_dir)
if not app_bundles:
@@ -535,7 +543,8 @@ def main():
dmg_filepath,
background_image_filepath,
volume_name,
applescript)
applescript,
codesign)
if __name__ == "__main__":

View File

@@ -23,8 +23,9 @@ import shutil
import buildbot_utils
def get_cmake_options(builder):
post_install_script = os.path.join(
codesign_script = os.path.join(
builder.blender_dir, 'build_files', 'buildbot', 'worker_codesign.cmake')
config_file = "build_files/cmake/config/blender_release.cmake"
@@ -36,18 +37,32 @@ def get_cmake_options(builder):
options.append('-DCMAKE_OSX_DEPLOYMENT_TARGET=10.9')
elif builder.platform == 'win':
options.extend(['-G', 'Visual Studio 16 2019', '-A', 'x64'])
options.extend(['-DPOSTINSTALL_SCRIPT:PATH=' + post_install_script])
if builder.codesign:
options.extend(['-DPOSTINSTALL_SCRIPT:PATH=' + codesign_script])
elif builder.platform == 'linux':
config_file = "build_files/buildbot/config/blender_linux.cmake"
optix_sdk_dir = os.path.join(builder.blender_dir, '..', '..', 'NVIDIA-Optix-SDK')
options.append('-DOPTIX_ROOT_DIR:PATH=' + optix_sdk_dir)
# Workaround to build sm_30 kernels with CUDA 10, since CUDA 11 no longer supports that architecture
if builder.platform == 'win':
options.append('-DCUDA10_TOOLKIT_ROOT_DIR:PATH=C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v10.1')
options.append('-DCUDA10_NVCC_EXECUTABLE:FILEPATH=C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v10.1/bin/nvcc.exe')
options.append('-DCUDA11_TOOLKIT_ROOT_DIR:PATH=C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.1')
options.append('-DCUDA11_NVCC_EXECUTABLE:FILEPATH=C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.1/bin/nvcc.exe')
elif builder.platform == 'linux':
options.append('-DCUDA10_TOOLKIT_ROOT_DIR:PATH=/usr/local/cuda-10.1')
options.append('-DCUDA10_NVCC_EXECUTABLE:FILEPATH=/usr/local/cuda-10.1/bin/nvcc')
options.append('-DCUDA11_TOOLKIT_ROOT_DIR:PATH=/usr/local/cuda-11.1')
options.append('-DCUDA11_NVCC_EXECUTABLE:FILEPATH=/usr/local/cuda-11.1/bin/nvcc')
options.append("-C" + os.path.join(builder.blender_dir, config_file))
options.append("-DCMAKE_INSTALL_PREFIX=%s" % (builder.install_dir))
return options
def update_git(builder):
# Do extra git fetch because not all platform/git/buildbot combinations
# update the origin remote, causing buildinfo to detect local changes.
@@ -57,6 +72,7 @@ def update_git(builder):
command = ['git', 'fetch', '--all']
buildbot_utils.call(builder.command_prefix + command)
def clean_directories(builder):
# Make sure no garbage remained from the previous run
if os.path.isdir(builder.install_dir):
@@ -72,6 +88,7 @@ def clean_directories(builder):
print("Removing {}" . format(buildinfo))
os.remove(full_path)
def cmake_configure(builder):
# CMake configuration
os.chdir(builder.build_dir)
@@ -86,6 +103,7 @@ def cmake_configure(builder):
command = ['cmake', builder.blender_dir] + cmake_options
buildbot_utils.call(builder.command_prefix + command)
def cmake_build(builder):
# CMake build
os.chdir(builder.build_dir)
@@ -108,6 +126,7 @@ def cmake_build(builder):
print("CMake build:")
buildbot_utils.call(builder.command_prefix + command)
if __name__ == "__main__":
builder = buildbot_utils.create_builder_from_arguments()
update_git(builder)

View File

@@ -29,18 +29,20 @@ from pathlib import Path
import buildbot_utils
def get_package_name(builder, platform=None):
info = buildbot_utils.VersionInfo(builder)
package_name = 'blender-' + info.full_version
if platform:
package_name += '-' + platform
package_name += '-' + platform
if not (builder.branch == 'master' or builder.is_release_branch):
if info.is_development_build:
package_name = builder.branch + "-" + package_name
return package_name
def sign_file_or_directory(path):
from codesign.simple_code_signer import SimpleCodeSigner
code_signer = SimpleCodeSigner()
@@ -64,6 +66,7 @@ def create_buildbot_upload_zip(builder, package_files):
sys.stderr.write('Create buildbot_upload.zip failed: ' + str(ex) + '\n')
sys.exit(1)
def create_tar_xz(src, dest, package_name):
# One extra to remove leading os.sep when cleaning root for package_root
ln = len(src) + 1
@@ -91,6 +94,7 @@ def create_tar_xz(src, dest, package_name):
package.add(entry[0], entry[1], recursive=False, filter=_fakeroot)
package.close()
def cleanup_files(dirpath, extension):
for f in os.listdir(dirpath):
filepath = os.path.join(dirpath, f)
@@ -117,6 +121,8 @@ def pack_mac(builder):
if info.is_development_build:
background_image = os.path.join(release_dir, 'buildbot', 'background.tif')
command += ['--background-image', background_image]
if builder.codesign:
command += ['--codesign']
command += [builder.install_dir]
buildbot_utils.call(command)
@@ -150,7 +156,8 @@ def pack_win(builder):
package_filename = package_name + '.msi'
package_filepath = os.path.join(builder.build_dir, package_filename)
sign_file_or_directory(package_filepath)
if builder.codesign:
sign_file_or_directory(package_filepath)
package_files += [(package_filepath, package_filename)]
@@ -168,7 +175,11 @@ def pack_linux(builder):
print("Stripping python...")
py_target = os.path.join(builder.install_dir, info.short_version)
buildbot_utils.call(builder.command_prefix + ['find', py_target, '-iname', '*.so', '-exec', 'strip', '-s', '{}', ';'])
buildbot_utils.call(
builder.command_prefix + [
'find', py_target, '-iname', '*.so', '-exec', 'strip', '-s', '{}', ';',
],
)
# Construct package name
platform_name = 'linux64'

View File

@@ -22,18 +22,21 @@ import buildbot_utils
import os
import sys
def get_ctest_arguments(builder):
args = ['--output-on-failure']
if builder.platform == 'win':
args += ['-C', 'Release']
return args
def test(builder):
os.chdir(builder.build_dir)
command = builder.command_prefix + ['ctest'] + get_ctest_arguments(builder)
command = builder.command_prefix + ['ctest'] + get_ctest_arguments(builder)
buildbot_utils.call(command)
if __name__ == "__main__":
builder = buildbot_utils.create_builder_from_arguments()
test(builder)

View File

@@ -12,12 +12,8 @@
#=============================================================================
# Copyright 2016 Blender Foundation.
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
# Distributed under the OSI-approved BSD 3-Clause License,
# see accompanying file BSD-3-Clause-license.txt for details.
#=============================================================================
# If ALEMBIC_ROOT_DIR was defined in the environment, use it.
@@ -51,12 +47,12 @@ FIND_LIBRARY(ALEMBIC_LIBRARY
# handle the QUIETLY and REQUIRED arguments and set ALEMBIC_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(ALEMBIC DEFAULT_MSG ALEMBIC_LIBRARY ALEMBIC_INCLUDE_DIR)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Alembic DEFAULT_MSG ALEMBIC_LIBRARY ALEMBIC_INCLUDE_DIR)
IF(ALEMBIC_FOUND)
SET(ALEMBIC_LIBRARIES ${ALEMBIC_LIBRARY})
SET(ALEMBIC_INCLUDE_DIRS ${ALEMBIC_INCLUDE_DIR})
ENDIF(ALEMBIC_FOUND)
ENDIF()
MARK_AS_ADVANCED(
ALEMBIC_INCLUDE_DIR

View File

@@ -11,6 +11,13 @@
# AUDASPACE_PY_INCLUDE_DIRS - the audaspace's python binding include directories
# AUDASPACE_PY_LIBRARIES - link these to use audaspace's python binding
#=============================================================================
# Copyright 2014 Blender Foundation.
#
# Distributed under the OSI-approved BSD 3-Clause License,
# see accompanying file BSD-3-Clause-license.txt for details.
#=============================================================================
IF(NOT AUDASPACE_ROOT_DIR AND NOT $ENV{AUDASPACE_ROOT_DIR} STREQUAL "")
SET(AUDASPACE_ROOT_DIR $ENV{AUDASPACE_ROOT_DIR})
ENDIF()
@@ -23,7 +30,7 @@ SET(_audaspace_SEARCH_DIRS
FIND_PACKAGE(PkgConfig)
IF(PKG_CONFIG_FOUND)
PKG_CHECK_MODULES(AUDASPACE_PKGCONF audaspace)
ENDIF(PKG_CONFIG_FOUND)
ENDIF()
# Include dir
FIND_PATH(AUDASPACE_INCLUDE_DIR
@@ -81,17 +88,17 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(Audaspace_Py DEFAULT_MSG AUDASPACE_PY_LIBRAR
IF(AUDASPACE_FOUND)
SET(AUDASPACE_LIBRARIES ${AUDASPACE_LIBRARY})
SET(AUDASPACE_INCLUDE_DIRS ${AUDASPACE_INCLUDE_DIR})
ENDIF(AUDASPACE_FOUND)
ENDIF()
IF(AUDASPACE_C_FOUND)
SET(AUDASPACE_C_LIBRARIES ${AUDASPACE_C_LIBRARY})
SET(AUDASPACE_C_INCLUDE_DIRS ${AUDASPACE_C_INCLUDE_DIR})
ENDIF(AUDASPACE_C_FOUND)
ENDIF()
IF(AUDASPACE_PY_FOUND)
SET(AUDASPACE_PY_LIBRARIES ${AUDASPACE_PY_LIBRARY})
SET(AUDASPACE_PY_INCLUDE_DIRS ${AUDASPACE_PY_INCLUDE_DIR})
ENDIF(AUDASPACE_PY_FOUND)
ENDIF()
MARK_AS_ADVANCED(
AUDASPACE_LIBRARY

View File

@@ -14,12 +14,8 @@
#=============================================================================
# Copyright 2018 Blender Foundation.
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
# Distributed under the OSI-approved BSD 3-Clause License,
# see accompanying file BSD-3-Clause-license.txt for details.
#=============================================================================
# If BLOSC_ROOT_DIR was defined in the environment, use it.
@@ -53,7 +49,7 @@ FIND_LIBRARY(BLOSC_LIBRARY
# handle the QUIETLY and REQUIRED arguments and set BLOSC_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(BLOSC DEFAULT_MSG
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Blosc DEFAULT_MSG
BLOSC_LIBRARY BLOSC_INCLUDE_DIR)
IF(BLOSC_FOUND)

View File

@@ -17,12 +17,8 @@
#=============================================================================
# Copyright 2020 Blender Foundation.
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
# Distributed under the OSI-approved BSD 3-Clause License,
# see accompanying file BSD-3-Clause-license.txt for details.
#=============================================================================
# If CLANG_TIDY_ROOT_DIR was defined in the environment, use it.
@@ -47,7 +43,10 @@ find_program(CLANG_TIDY_EXECUTABLE
${_clang_tidy_SEARCH_DIRS}
)
if(CLANG_TIDY_EXECUTABLE)
if(CLANG_TIDY_EXECUTABLE AND NOT EXISTS ${CLANG_TIDY_EXECUTABLE})
message(WARNING "Cached or directly specified Clang-Tidy executable does not exist.")
set(CLANG_TIDY_FOUND FALSE)
elseif(CLANG_TIDY_EXECUTABLE)
# Mark clang-tidy as found.
set(CLANG_TIDY_FOUND TRUE)

View File

@@ -10,12 +10,8 @@
#=============================================================================
# Copyright 2015 Blender Foundation.
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
# Distributed under the OSI-approved BSD 3-Clause License,
# see accompanying file BSD-3-Clause-license.txt for details.
#=============================================================================
# If EIGEN3_ROOT_DIR was defined in the environment, use it.
@@ -45,7 +41,7 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(Eigen3 DEFAULT_MSG
IF(EIGEN3_FOUND)
SET(EIGEN3_INCLUDE_DIRS ${EIGEN3_INCLUDE_DIR})
ENDIF(EIGEN3_FOUND)
ENDIF()
MARK_AS_ADVANCED(
EIGEN3_INCLUDE_DIR

View File

@@ -7,19 +7,12 @@
# EMBREE_ROOT_DIR, The base directory to search for Embree.
# This can also be an environment variable.
# EMBREEFOUND, If false, do not try to use Embree.
#
# also defined, but not for general use are
# EMBREE_LIBRARY, where to find the Embree library.
#=============================================================================
# Copyright 2018 Blender Foundation.
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
# Distributed under the OSI-approved BSD 3-Clause License,
# see accompanying file BSD-3-Clause-license.txt for details.
#=============================================================================
# If EMBREE_ROOT_DIR was defined in the environment, use it.
@@ -44,9 +37,9 @@ FIND_PATH(EMBREE_INCLUDE_DIR
SET(_embree_FIND_COMPONENTS
embree3
embree_sse42
embree_avx
embree_avx2
embree_sse42
lexers
math
simd
@@ -66,19 +59,18 @@ FOREACH(COMPONENT ${_embree_FIND_COMPONENTS})
PATH_SUFFIXES
lib64 lib
)
IF (NOT EMBREE_${UPPERCOMPONENT}_LIBRARY)
IF (EMBREE_EMBREE3_LIBRARY)
# If we can't find all the static libraries, try to fall back to the shared library if found.
# This allows building with a shared embree library
SET(_embree_LIBRARIES ${EMBREE_EMBREE3_LIBRARY})
BREAK()
ENDIF ()
ENDIF ()
LIST(APPEND _embree_LIBRARIES "${EMBREE_${UPPERCOMPONENT}_LIBRARY}")
ENDFOREACH()
FIND_LIBRARY(EMBREE_LIBRARY
NAMES
libembree3
HINTS
${_embree_SEARCH_DIRS}
PATH_SUFFIXES
lib64 lib
)
# handle the QUIETLY and REQUIRED arguments and set EMBREE_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
@@ -88,7 +80,7 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(Embree DEFAULT_MSG
IF(EMBREE_FOUND)
SET(EMBREE_LIBRARIES ${_embree_LIBRARIES})
SET(EMBREE_INCLUDE_DIRS ${EMBREE_INCLUDE_DIR})
ENDIF(EMBREE_FOUND)
ENDIF()
MARK_AS_ADVANCED(
EMBREE_INCLUDE_DIR

View File

@@ -0,0 +1,83 @@
# - Find FFmpeg library and includes.
# Set FFMPEG_FIND_COMPONENTS to the canonical names of the libraries
# before using the module.
# This module defines
# FFMPEG_INCLUDE_DIRS, where to find libavcodec/ac3_parser.h.
# FFMPEG_LIBRARIES, libraries to link against to use FFmpeg.
# FFMPEG_ROOT_DIR, The base directory to search for FFmpeg.
# This can also be an environment variable.
# FFMPEG_FOUND, If false, do not try to use FFmpeg.
# FFMPEG_<COMPONENT>_LIBRARY, the given individual component libraries.
#=============================================================================
# Copyright 2020 Blender Foundation.
#
# Distributed under the OSI-approved BSD 3-Clause License,
# see accompanying file BSD-3-Clause-license.txt for details.
#=============================================================================
# If FFMPEG_ROOT_DIR was defined in the environment, use it.
if(NOT FFMPEG_ROOT_DIR AND NOT $ENV{FFMPEG_ROOT_DIR} STREQUAL "")
set(FFMPEG_ROOT_DIR $ENV{FFMPEG_ROOT_DIR})
endif()
set(_ffmpeg_SEARCH_DIRS
${FFMPEG_ROOT_DIR}
/opt/lib/ffmpeg
)
if(NOT FFMPEG_FIND_COMPONENTS)
set(FFMPEG_FIND_COMPONENTS
# List taken from http://ffmpeg.org/download.html#build-mac
avcodec
avdevice
avfilter
avformat
avutil
)
endif()
find_path(_ffmpeg_INCLUDE_DIR
NAMES
libavcodec/ac3_parser.h
HINTS
${_ffmpeg_SEARCH_DIRS}
PATH_SUFFIXES
include
)
set(_ffmpeg_LIBRARIES)
foreach(_component ${FFMPEG_FIND_COMPONENTS})
string(TOUPPER ${_component} _upper_COMPONENT)
find_library(FFMPEG_${_upper_COMPONENT}_LIBRARY
NAMES
${_upper_COMPONENT}
HINTS
${LIBDIR}/ffmpeg
PATH_SUFFIXES
lib64 lib
)
if(NOT FFMPEG_${_upper_COMPONENT}_LIBRARY)
message(WARNING "Could NOT find FFmpeg ${_upper_COMPONENT}.")
endif()
list(APPEND _ffmpeg_LIBRARIES ${FFMPEG_${_upper_COMPONENT}_LIBRARY})
mark_as_advanced(FFMPEG_${_upper_COMPONENT}_LIBRARY)
endforeach()
# handle the QUIETLY and REQUIRED arguments and set FFMPEG_FOUND to TRUE if
# all listed variables are TRUE
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(FFmpeg DEFAULT_MSG
_ffmpeg_LIBRARIES _ffmpeg_INCLUDE_DIR)
IF(FFMPEG_FOUND)
set(FFMPEG_LIBRARIES ${_ffmpeg_LIBRARIES})
set(FFMPEG_INCLUDE_DIRS ${_ffmpeg_INCLUDE_DIR})
ENDIF()
mark_as_advanced(
FFMPEG_INCLUDE_DIR
)
unset(_ffmpeg_SEARCH_DIRS)
unset(_ffmpeg_LIBRARIES)
unset(_ffmpeg_INCLUDE_DIR)

View File

@@ -14,12 +14,8 @@
#=============================================================================
# Copyright 2011 Blender Foundation.
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
# Distributed under the OSI-approved BSD 3-Clause License,
# see accompanying file BSD-3-Clause-license.txt for details.
#=============================================================================
# If FFTW3_ROOT_DIR was defined in the environment, use it.
@@ -58,7 +54,7 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(Fftw3 DEFAULT_MSG
IF(FFTW3_FOUND)
SET(FFTW3_LIBRARIES ${FFTW3_LIBRARY})
SET(FFTW3_INCLUDE_DIRS ${FFTW3_INCLUDE_DIR})
ENDIF(FFTW3_FOUND)
ENDIF()
MARK_AS_ADVANCED(
FFTW3_INCLUDE_DIR

View File

@@ -13,12 +13,8 @@
#=============================================================================
# Copyright 2014 Blender Foundation.
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
# Distributed under the OSI-approved BSD 3-Clause License,
# see accompanying file BSD-3-Clause-license.txt for details.
#=============================================================================
# If GLEW_ROOT_DIR was defined in the environment, use it.
@@ -51,12 +47,12 @@ FIND_LIBRARY(GLEW_LIBRARY
# handle the QUIETLY and REQUIRED arguments and set GLEW_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Glew DEFAULT_MSG
FIND_PACKAGE_HANDLE_STANDARD_ARGS(GLEW DEFAULT_MSG
GLEW_LIBRARY GLEW_INCLUDE_DIR)
IF(GLEW_FOUND)
SET(GLEW_INCLUDE_DIRS ${GLEW_INCLUDE_DIR})
ENDIF(GLEW_FOUND)
ENDIF()
MARK_AS_ADVANCED(
GLEW_INCLUDE_DIR

View File

@@ -0,0 +1,92 @@
# - Find GMP library
# Find the native GMP includes and library
# This module defines
# GMP_INCLUDE_DIRS, where to find gmp.h, Set when
# GMP_INCLUDE_DIR is found.
# GMP_LIBRARIES, libraries to link against to use GMP.
# GMP_ROOT_DIR, The base directory to search for GMP.
# This can also be an environment variable.
# GMP_FOUND, If false, do not try to use GMP.
#
# also defined, but not for general use are
# GMP_LIBRARY, where to find the GMP library.
#=============================================================================
# Copyright 2011 Blender Foundation.
#
# Distributed under the OSI-approved BSD 3-Clause License,
# see accompanying file BSD-3-Clause-license.txt for details.
#=============================================================================
# If GMP_ROOT_DIR was defined in the environment, use it.
IF(NOT GMP_ROOT_DIR AND NOT $ENV{GMP_ROOT_DIR} STREQUAL "")
SET(GMP_ROOT_DIR $ENV{GMP_ROOT_DIR})
ENDIF()
SET(_gmp_SEARCH_DIRS
${GMP_ROOT_DIR}
/opt/lib/gmp
)
FIND_PATH(GMP_INCLUDE_DIR
NAMES
gmp.h
HINTS
${_gmp_SEARCH_DIRS}
PATH_SUFFIXES
include/gmp
)
FIND_PATH(GMPXX_INCLUDE_DIR
NAMES
gmpxx.h
HINTS
${_gmp_SEARCH_DIRS}
PATH_SUFFIXES
include/gmp
)
FIND_LIBRARY(GMP_LIBRARY
NAMES
gmp
HINTS
${_gmp_SEARCH_DIRS}
PATH_SUFFIXES
lib64 lib
)
FIND_LIBRARY(GMPXX_LIBRARY
NAMES
gmpxx
HINTS
${_gmp_SEARCH_DIRS}
PATH_SUFFIXES
lib64 lib
)
if(GMP_INCLUDE_DIR)
SET(_version_regex "^#define[ \t]+__GNU_MP_VERSION[ \t]+\"([^\"]+)\".*")
file(STRINGS "${GMP_INCLUDE_DIR}/gmp.h"
GMP_VERSION REGEX "${_version_regex}")
string(REGEX REPLACE "${_version_regex}" "\\1"
GMP_VERSION "${GMP_VERSION}")
unset(_version_regex)
endif()
# handle the QUIETLY and REQUIRED arguments and set GMP_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(GMP DEFAULT_MSG
GMP_LIBRARY GMPXX_LIBRARY GMP_INCLUDE_DIR GMPXX_INCLUDE_DIR)
IF(GMP_FOUND)
SET(GMP_LIBRARIES ${GMPXX_LIBRARY} ${GMP_LIBRARY})
SET(GMP_INCLUDE_DIRS ${GMP_INCLUDE_DIR} ${GMPXX_INCLUDE_DIR})
ENDIF()
MARK_AS_ADVANCED(
GMP_INCLUDE_DIR
GMP_LIBRARY
GMPXX_INCLUDE_DIR
GMPXX_LIBRARY
)

View File

@@ -12,12 +12,8 @@
#=============================================================================
# Copyright 2012 Blender Foundation.
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
# Distributed under the OSI-approved BSD 3-Clause License,
# see accompanying file BSD-3-Clause-license.txt for details.
#=============================================================================
# If ICU_ROOT_DIR was defined in the environment, use it.
@@ -128,7 +124,7 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(Icu DEFAULT_MSG
IF(ICU_FOUND)
SET(ICU_LIBRARIES ${ICU_LIBRARY_DATA} ${ICU_LIBRARY_I18N} ${ICU_LIBRARY_IO} ${ICU_LIBRARY_LE} ${ICU_LIBRARY_LX} ${ICU_LIBRARY_TU} ${ICU_LIBRARY_UC})
SET(ICU_INCLUDE_DIRS ${ICU_INCLUDE_DIR})
ENDIF(ICU_FOUND)
ENDIF()
MARK_AS_ADVANCED(
ICU_INCLUDE_DIR

View File

@@ -14,12 +14,8 @@
#=============================================================================
# Copyright 2011 Blender Foundation.
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
# Distributed under the OSI-approved BSD 3-Clause License,
# see accompanying file BSD-3-Clause-license.txt for details.
#=============================================================================
# If JACK_ROOT_DIR was defined in the environment, use it.
@@ -58,7 +54,7 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(Jack DEFAULT_MSG
IF(JACK_FOUND)
SET(JACK_LIBRARIES ${JACK_LIBRARY})
SET(JACK_INCLUDE_DIRS ${JACK_INCLUDE_DIR})
ENDIF(JACK_FOUND)
ENDIF()
MARK_AS_ADVANCED(
JACK_INCLUDE_DIR

View File

@@ -14,12 +14,8 @@
#=============================================================================
# Copyright 2011 Blender Foundation.
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
# Distributed under the OSI-approved BSD 3-Clause License,
# see accompanying file BSD-3-Clause-license.txt for details.
#=============================================================================
# If JEMALLOC_ROOT_DIR was defined in the environment, use it.
@@ -68,7 +64,7 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(JeMalloc DEFAULT_MSG
IF(JEMALLOC_FOUND)
SET(JEMALLOC_LIBRARIES ${JEMALLOC_LIBRARY})
SET(JEMALLOC_INCLUDE_DIRS ${JEMALLOC_INCLUDE_DIR})
ENDIF(JEMALLOC_FOUND)
ENDIF()
MARK_AS_ADVANCED(
JEMALLOC_INCLUDE_DIR

View File

@@ -13,12 +13,8 @@
#=============================================================================
# Copyright 2015 Blender Foundation.
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
# Distributed under the OSI-approved BSD 3-Clause License,
# see accompanying file BSD-3-Clause-license.txt for details.
#=============================================================================
if(LLVM_ROOT_DIR)
@@ -38,6 +34,10 @@ else()
endif()
endif()
execute_process(COMMAND ${LLVM_CONFIG} --includedir
OUTPUT_VARIABLE LLVM_INCLUDE_DIRS
OUTPUT_STRIP_TRAILING_WHITESPACE)
if(NOT DEFINED LLVM_VERSION)
execute_process(COMMAND ${LLVM_CONFIG} --version
OUTPUT_VARIABLE LLVM_VERSION
@@ -84,7 +84,7 @@ if(LLVM_LIBRARY AND LLVM_ROOT_DIR AND LLVM_LIBPATH)
endif()
# handle the QUIETLY and REQUIRED arguments and set SDL2_FOUND to TRUE if
# handle the QUIETLY and REQUIRED arguments and set LLVM_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(LLVM DEFAULT_MSG

View File

@@ -14,12 +14,8 @@
#=============================================================================
# Copyright 2015 Blender Foundation.
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
# Distributed under the OSI-approved BSD 3-Clause License,
# see accompanying file BSD-3-Clause-license.txt for details.
#=============================================================================
# If LZO_ROOT_DIR was defined in the environment, use it.
@@ -56,7 +52,7 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(LZO DEFAULT_MSG
IF(LZO_FOUND)
SET(LZO_LIBRARIES ${LZO_LIBRARY})
SET(LZO_INCLUDE_DIRS ${LZO_INCLUDE_DIR})
ENDIF(LZO_FOUND)
ENDIF()
MARK_AS_ADVANCED(
LZO_INCLUDE_DIR

View File

@@ -0,0 +1,49 @@
# - Find NanoVDB library
# Find the native NanoVDB includes and library
# This module defines
# NANOVDB_INCLUDE_DIRS, where to find nanovdb.h, Set when
# NANOVDB_INCLUDE_DIR is found.
# NANOVDB_ROOT_DIR, The base directory to search for NanoVDB.
# This can also be an environment variable.
# NANOVDB_FOUND, If false, do not try to use NanoVDB.
#=============================================================================
# Copyright 2020 Blender Foundation.
#
# Distributed under the OSI-approved BSD 3-Clause License,
# see accompanying file BSD-3-Clause-license.txt for details.
#=============================================================================
# If NANOVDB_ROOT_DIR was defined in the environment, use it.
IF(NOT NANOVDB_ROOT_DIR AND NOT $ENV{NANOVDB_ROOT_DIR} STREQUAL "")
SET(NANOVDB_ROOT_DIR $ENV{NANOVDB_ROOT_DIR})
ENDIF()
SET(_nanovdb_SEARCH_DIRS
${NANOVDB_ROOT_DIR}
)
FIND_PATH(NANOVDB_INCLUDE_DIR
NAMES
nanovdb/NanoVDB.h
HINTS
${_nanovdb_SEARCH_DIRS}
PATH_SUFFIXES
include
)
# handle the QUIETLY and REQUIRED arguments and set NANOVDB_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(NanoVDB DEFAULT_MSG
NANOVDB_INCLUDE_DIR)
IF(NANOVDB_FOUND)
SET(NANOVDB_INCLUDE_DIRS ${NANOVDB_INCLUDE_DIR})
ENDIF(NANOVDB_FOUND)
MARK_AS_ADVANCED(
NANOVDB_INCLUDE_DIR
)
UNSET(_nanovdb_SEARCH_DIRS)

View File

@@ -14,12 +14,8 @@
#=============================================================================
# Copyright 2014 Blender Foundation.
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
# Distributed under the OSI-approved BSD 3-Clause License,
# see accompanying file BSD-3-Clause-license.txt for details.
#=============================================================================
# If OSL_ROOT_DIR was defined in the environment, use it.
@@ -99,7 +95,7 @@ IF(OSL_FOUND)
"\\1" OSL_LIBRARY_VERSION_MAJOR ${OSL_LIBRARY_VERSION_MAJOR})
STRING(REGEX REPLACE ".*#define[ \t]+OSL_LIBRARY_VERSION_MINOR[ \t]+([.0-9]+).*"
"\\1" OSL_LIBRARY_VERSION_MINOR ${OSL_LIBRARY_VERSION_MINOR})
ENDIF(OSL_FOUND)
ENDIF()
MARK_AS_ADVANCED(
OSL_INCLUDE_DIR

View File

@@ -7,19 +7,12 @@
# OPENCOLLADA_ROOT_DIR, The base directory to search for OpenCOLLADA.
# This can also be an environment variable.
# OPENCOLLADA_FOUND, If false, do not try to use OpenCOLLADA.
#
# also defined, but not for general use are
# OPENCOLLADA_LIBRARY, where to find the OpenCOLLADA library.
#=============================================================================
# Copyright 2011 Blender Foundation.
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
# Distributed under the OSI-approved BSD 3-Clause License,
# see accompanying file BSD-3-Clause-license.txt for details.
#=============================================================================
# note about include paths, there are 2 ways includes are set
@@ -136,7 +129,7 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(OpenCOLLADA DEFAULT_MSG
IF(OPENCOLLADA_FOUND)
SET(OPENCOLLADA_LIBRARIES ${_opencollada_LIBRARIES})
SET(OPENCOLLADA_INCLUDE_DIRS ${_opencollada_INCLUDES})
ENDIF(OPENCOLLADA_FOUND)
ENDIF()
UNSET(COMPONENT)
UNSET(UPPERCOMPONENT)

View File

@@ -14,12 +14,8 @@
#=============================================================================
# Copyright 2012 Blender Foundation.
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
# Distributed under the OSI-approved BSD 3-Clause License,
# see accompanying file BSD-3-Clause-license.txt for details.
#=============================================================================
# If OPENCOLORIO_ROOT_DIR was defined in the environment, use it.
@@ -74,7 +70,7 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(OpenColorIO DEFAULT_MSG
IF(OPENCOLORIO_FOUND)
SET(OPENCOLORIO_LIBRARIES ${_opencolorio_LIBRARIES})
SET(OPENCOLORIO_INCLUDE_DIRS ${OPENCOLORIO_INCLUDE_DIR})
ENDIF(OPENCOLORIO_FOUND)
ENDIF()
MARK_AS_ADVANCED(
OPENCOLORIO_INCLUDE_DIR

View File

@@ -21,12 +21,8 @@
#=============================================================================
# Copyright 2011 Blender Foundation.
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
# Distributed under the OSI-approved BSD 3-Clause License,
# see accompanying file BSD-3-Clause-license.txt for details.
#=============================================================================
# If OPENEXR_ROOT_DIR was defined in the environment, use it.

View File

@@ -10,6 +10,13 @@
# OPENGLES_LIBRARIES - all libraries needed for OpenGLES
# OPENGLES_INCLUDES - all includes needed for OpenGLES
#=============================================================================
# Copyright 2014 Blender Foundation.
#
# Distributed under the OSI-approved BSD 3-Clause License,
# see accompanying file BSD-3-Clause-license.txt for details.
#=============================================================================
# If OPENGLES_ROOT_DIR was defined in the environment, use it.
IF(NOT OPENGLES_ROOT_DIR AND NOT $ENV{OPENGLES_ROOT_DIR} STREQUAL "")
SET(OPENGLES_ROOT_DIR $ENV{OPENGLES_ROOT_DIR})

View File

@@ -14,12 +14,8 @@
#=============================================================================
# Copyright 2019 Blender Foundation.
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
# Distributed under the OSI-approved BSD 3-Clause License,
# see accompanying file BSD-3-Clause-license.txt for details.
#=============================================================================
# If OPENIMAGEDENOISE_ROOT_DIR was defined in the environment, use it.

View File

@@ -16,12 +16,8 @@
#=============================================================================
# Copyright 2011 Blender Foundation.
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
# Distributed under the OSI-approved BSD 3-Clause License,
# see accompanying file BSD-3-Clause-license.txt for details.
#=============================================================================
# If OPENIMAGEIO_ROOT_DIR was defined in the environment, use it.

View File

@@ -14,12 +14,8 @@
#=============================================================================
# Copyright 2011 Blender Foundation.
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
# Distributed under the OSI-approved BSD 3-Clause License,
# see accompanying file BSD-3-Clause-license.txt for details.
#=============================================================================
# If OPENJPEG_ROOT_DIR was defined in the environment, use it.
@@ -69,7 +65,7 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(OpenJPEG DEFAULT_MSG
IF(OPENJPEG_FOUND)
SET(OPENJPEG_LIBRARIES ${OPENJPEG_LIBRARY})
SET(OPENJPEG_INCLUDE_DIRS ${OPENJPEG_INCLUDE_DIR})
ENDIF(OPENJPEG_FOUND)
ENDIF()
MARK_AS_ADVANCED(
OPENJPEG_INCLUDE_DIR

View File

@@ -7,19 +7,12 @@
# OPENSUBDIV_ROOT_DIR, the base directory to search for OpenSubdiv.
# This can also be an environment variable.
# OPENSUBDIV_FOUND, if false, do not try to use OpenSubdiv.
#
# also defined, but not for general use are
# OPENSUBDIV_LIBRARY, where to find the OpenSubdiv library.
#=============================================================================
# Copyright 2013 Blender Foundation.
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
# Distributed under the OSI-approved BSD 3-Clause License,
# see accompanying file BSD-3-Clause-license.txt for details.
#=============================================================================
# If OPENSUBDIV_ROOT_DIR was defined in the environment, use it.
@@ -97,7 +90,7 @@ IF(OPENSUBDIV_FOUND)
OPENSUBDIV_CHECK_CONTROLLER("cudaEvaluator.h" OPENSUBDIV_HAS_CUDA)
OPENSUBDIV_CHECK_CONTROLLER("glXFBEvaluator.h" OPENSUBDIV_HAS_GLSL_TRANSFORM_FEEDBACK)
OPENSUBDIV_CHECK_CONTROLLER("glComputeEvaluator.h" OPENSUBDIV_HAS_GLSL_COMPUTE)
ENDIF(OPENSUBDIV_FOUND)
ENDIF()
MARK_AS_ADVANCED(
OPENSUBDIV_INCLUDE_DIR

View File

@@ -14,12 +14,8 @@
#=============================================================================
# Copyright 2015 Blender Foundation.
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
# Distributed under the OSI-approved BSD 3-Clause License,
# see accompanying file BSD-3-Clause-license.txt for details.
#=============================================================================
# If OPENVDB_ROOT_DIR was defined in the environment, use it.
@@ -53,13 +49,13 @@ FIND_LIBRARY(OPENVDB_LIBRARY
# handle the QUIETLY and REQUIRED arguments and set OPENVDB_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(OPENVDB DEFAULT_MSG
FIND_PACKAGE_HANDLE_STANDARD_ARGS(OpenVDB DEFAULT_MSG
OPENVDB_LIBRARY OPENVDB_INCLUDE_DIR)
IF(OPENVDB_FOUND)
SET(OPENVDB_LIBRARIES ${OPENVDB_LIBRARY})
SET(OPENVDB_INCLUDE_DIRS ${OPENVDB_INCLUDE_DIR})
ENDIF(OPENVDB_FOUND)
ENDIF()
MARK_AS_ADVANCED(
OPENVDB_INCLUDE_DIR

View File

@@ -10,12 +10,8 @@
#=============================================================================
# Copyright 2019 Blender Foundation.
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
# Distributed under the OSI-approved BSD 3-Clause License,
# see accompanying file BSD-3-Clause-license.txt for details.
#=============================================================================
# If OPTIX_ROOT_DIR was defined in the environment, use it.
@@ -45,7 +41,7 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(OptiX DEFAULT_MSG
IF(OPTIX_FOUND)
SET(OPTIX_INCLUDE_DIRS ${OPTIX_INCLUDE_DIR})
ENDIF(OPTIX_FOUND)
ENDIF()
MARK_AS_ADVANCED(
OPTIX_INCLUDE_DIR

View File

@@ -14,12 +14,8 @@
#=============================================================================
# Copyright 2011 Blender Foundation.
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
# Distributed under the OSI-approved BSD 3-Clause License,
# see accompanying file BSD-3-Clause-license.txt for details.
#=============================================================================
# If PCRE_ROOT_DIR was defined in the environment, use it.
@@ -61,7 +57,7 @@ SET(PCRE_LIBRARIES ${PCRE_LIBRARY})
IF(PCRE_FOUND)
SET(PCRE_INCLUDE_DIRS ${PCRE_INCLUDE_DIR})
ENDIF(PCRE_FOUND)
ENDIF()
MARK_AS_ADVANCED(
PCRE_INCLUDE_DIR

View File

@@ -0,0 +1,65 @@
# - Find potrace library
# Find the potrace include and library
# This module defines
# POTRACE_INCLUDE_DIRS, where to find potracelib.h, Set when
# POTRACE is found.
# POTRACE_LIBRARIES, libraries to link against to use POTRACE.
# POTRACE_ROOT_DIR, The base directory to search for POTRACE.
# This can also be an environment variable.
# POTRACE_FOUND, If false, do not try to use POTRACE.
#
# also defined, but not for general use are
# POTRACE_LIBRARY, where to find the POTRACE library.
#=============================================================================
# Copyright 2020 Blender Foundation.
#
# Distributed under the OSI-approved BSD 3-Clause License,
# see accompanying file BSD-3-Clause-license.txt for details.
#=============================================================================
# If POTRACE_ROOT_DIR was defined in the environment, use it.
IF(NOT POTRACE_ROOT_DIR AND NOT $ENV{POTRACE_ROOT_DIR} STREQUAL "")
SET(POTRACE_ROOT_DIR $ENV{POTRACE_ROOT_DIR})
ENDIF()
SET(_potrace_SEARCH_DIRS
${POTRACE_ROOT_DIR}
/opt/lib/potrace
/usr/include
/usr/local/include
)
FIND_PATH(POTRACE_INCLUDE_DIR
NAMES
potracelib.h
HINTS
${_potrace_SEARCH_DIRS}
PATH_SUFFIXES
include
)
FIND_LIBRARY(POTRACE_LIBRARY
NAMES
potrace
HINTS
${_potrace_SEARCH_DIRS}
PATH_SUFFIXES
lib64 lib
)
# handle the QUIETLY and REQUIRED arguments and set POTRACE_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Potrace DEFAULT_MSG
POTRACE_LIBRARY POTRACE_INCLUDE_DIR)
IF(POTRACE_FOUND)
SET(POTRACE_LIBRARIES ${POTRACE_LIBRARY})
SET(POTRACE_INCLUDE_DIRS ${POTRACE_INCLUDE_DIR})
ENDIF()
MARK_AS_ADVANCED(
POTRACE_INCLUDE_DIR
POTRACE_LIBRARY
)

View File

@@ -14,12 +14,8 @@
#=============================================================================
# Copyright 2014 Blender Foundation.
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
# Distributed under the OSI-approved BSD 3-Clause License,
# see accompanying file BSD-3-Clause-license.txt for details.
#=============================================================================
# If PUGIXML_ROOT_DIR was defined in the environment, use it.
@@ -53,7 +49,7 @@ FIND_LIBRARY(PUGIXML_LIBRARY
# handle the QUIETLY and REQUIRED arguments and set PUGIXML_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(PUGIXML DEFAULT_MSG
FIND_PACKAGE_HANDLE_STANDARD_ARGS(PugiXML DEFAULT_MSG
PUGIXML_LIBRARY PUGIXML_INCLUDE_DIR)
IF(PUGIXML_FOUND)

View File

@@ -25,12 +25,8 @@
#=============================================================================
# Copyright 2011 Blender Foundation.
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
# Distributed under the OSI-approved BSD 3-Clause License,
# see accompanying file BSD-3-Clause-license.txt for details.
#=============================================================================
# If PYTHON_ROOT_DIR was defined in the environment, use it.

View File

@@ -13,12 +13,8 @@
#=============================================================================
# Copyright 2015 Blender Foundation.
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
# Distributed under the OSI-approved BSD 3-Clause License,
# see accompanying file BSD-3-Clause-license.txt for details.
#=============================================================================
# If SDL2_ROOT_DIR was defined in the environment, use it.
@@ -57,7 +53,7 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDL2 DEFAULT_MSG
IF(SDL2_FOUND)
SET(SDL2_LIBRARIES ${SDL2_LIBRARY})
SET(SDL2_INCLUDE_DIRS ${SDL2_INCLUDE_DIR})
ENDIF(SDL2_FOUND)
ENDIF()
MARK_AS_ADVANCED(
SDL2_INCLUDE_DIR

View File

@@ -14,12 +14,8 @@
#=============================================================================
# Copyright 2011 Blender Foundation.
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
# Distributed under the OSI-approved BSD 3-Clause License,
# see accompanying file BSD-3-Clause-license.txt for details.
#=============================================================================
# If LIBSNDFILE_ROOT_DIR was defined in the environment, use it.
@@ -56,7 +52,7 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(SndFile DEFAULT_MSG
IF(SNDFILE_FOUND)
SET(LIBSNDFILE_LIBRARIES ${LIBSNDFILE_LIBRARY})
SET(LIBSNDFILE_INCLUDE_DIRS ${LIBSNDFILE_INCLUDE_DIR})
ENDIF(SNDFILE_FOUND)
ENDIF()
MARK_AS_ADVANCED(
LIBSNDFILE_INCLUDE_DIR

View File

@@ -14,12 +14,8 @@
#=============================================================================
# Copyright 2011 Blender Foundation.
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
# Distributed under the OSI-approved BSD 3-Clause License,
# see accompanying file BSD-3-Clause-license.txt for details.
#=============================================================================
# If SPACENAV_ROOT_DIR was defined in the environment, use it.
@@ -58,7 +54,7 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(Spacenav DEFAULT_MSG
IF(SPACENAV_FOUND)
SET(SPACENAV_LIBRARIES ${SPACENAV_LIBRARY})
SET(SPACENAV_INCLUDE_DIRS ${SPACENAV_INCLUDE_DIR})
ENDIF(SPACENAV_FOUND)
ENDIF()
MARK_AS_ADVANCED(
SPACENAV_INCLUDE_DIR

View File

@@ -14,12 +14,8 @@
#=============================================================================
# Copyright 2016 Blender Foundation.
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
# Distributed under the OSI-approved BSD 3-Clause License,
# see accompanying file BSD-3-Clause-license.txt for details.
#=============================================================================
# If TBB_ROOT_DIR was defined in the environment, use it.

View File

@@ -12,12 +12,8 @@
#=============================================================================
# Copyright 2019 Blender Foundation.
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
# Distributed under the OSI-approved BSD 3-Clause License,
# see accompanying file BSD-3-Clause-license.txt for details.
#=============================================================================
# If USD_ROOT_DIR was defined in the environment, use it.
@@ -63,7 +59,7 @@ ELSE()
get_filename_component(USD_LIBRARY_DIR ${USD_LIBRARY} DIRECTORY)
SET(USD_INCLUDE_DIRS ${USD_INCLUDE_DIR})
set(USD_LIBRARIES ${USD_LIBRARY})
ENDIF(USD_FOUND)
ENDIF()
ENDIF()
MARK_AS_ADVANCED(

View File

@@ -14,12 +14,8 @@
#=============================================================================
# Copyright 2011 Blender Foundation.
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
# Distributed under the OSI-approved BSD 3-Clause License,
# see accompanying file BSD-3-Clause-license.txt for details.
#=============================================================================
# If XML2_ROOT_DIR was defined in the environment, use it.
@@ -56,7 +52,7 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(XML2 DEFAULT_MSG
IF(XML2_FOUND)
SET(XML2_LIBRARIES ${XML2_LIBRARY})
SET(XML2_INCLUDE_DIRS ${XML2_INCLUDE_DIR})
ENDIF(XML2_FOUND)
ENDIF()
MARK_AS_ADVANCED(
XML2_INCLUDE_DIR

View File

@@ -20,12 +20,8 @@
# XR_OPENXR_SDK_LOADER_LIBRARY, where to find the OpenXR-SDK loader library.
#=============================================================================
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
# Distributed under the OSI-approved BSD 3-Clause License,
# see accompanying file BSD-3-Clause-license.txt for details.
#=============================================================================
# If XR_OPENXR_SDK_ROOT_DIR was defined in the environment, use it.
@@ -59,13 +55,13 @@ FIND_LIBRARY(XR_OPENXR_SDK_LOADER_LIBRARY
# handle the QUIETLY and REQUIRED arguments and set XR_OPENXR_SDK_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(XR_OPENXR_SDK DEFAULT_MSG
FIND_PACKAGE_HANDLE_STANDARD_ARGS(XR_OpenXR_SDK DEFAULT_MSG
XR_OPENXR_SDK_LOADER_LIBRARY XR_OPENXR_SDK_INCLUDE_DIR)
IF(XR_OPENXR_SDK_FOUND)
SET(XR_OPENXR_SDK_LIBRARIES ${XR_OPENXR_SDK_LOADER_LIBRARY})
SET(XR_OPENXR_SDK_INCLUDE_DIRS ${XR_OPENXR_SDK_INCLUDE_DIR})
ENDIF(XR_OPENXR_SDK_FOUND)
ENDIF()
MARK_AS_ADVANCED(
XR_OPENXR_SDK_INCLUDE_DIR

View File

@@ -0,0 +1,550 @@
# Distributed under the OSI-approved BSD 3-Clause License,
# see accompanying file BSD-3-Clause-license.txt for details.
#[=======================================================================[.rst:
GoogleTest
----------
.. versionadded:: 3.9
This module defines functions to help use the Google Test infrastructure. Two
mechanisms for adding tests are provided. :command:`gtest_add_tests` has been
around for some time, originally via ``find_package(GTest)``.
:command:`gtest_discover_tests` was introduced in CMake 3.10.
The (older) :command:`gtest_add_tests` scans source files to identify tests.
This is usually effective, with some caveats, including in cross-compiling
environments, and makes setting additional properties on tests more convenient.
However, its handling of parameterized tests is less comprehensive, and it
requires re-running CMake to detect changes to the list of tests.
The (newer) :command:`gtest_discover_tests` discovers tests by asking the
compiled test executable to enumerate its tests. This is more robust and
provides better handling of parameterized tests, and does not require CMake
to be re-run when tests change. However, it may not work in a cross-compiling
environment, and setting test properties is less convenient.
More details can be found in the documentation of the respective functions.
Both commands are intended to replace use of :command:`add_test` to register
tests, and will create a separate CTest test for each Google Test test case.
Note that this is in some cases less efficient, as common set-up and tear-down
logic cannot be shared by multiple test cases executing in the same instance.
However, it provides more fine-grained pass/fail information to CTest, which is
usually considered as more beneficial. By default, the CTest test name is the
same as the Google Test name (i.e. ``suite.testcase``); see also
``TEST_PREFIX`` and ``TEST_SUFFIX``.
.. command:: gtest_add_tests
Automatically add tests with CTest by scanning source code for Google Test
macros::
gtest_add_tests(TARGET target
[SOURCES src1...]
[EXTRA_ARGS arg1...]
[WORKING_DIRECTORY dir]
[TEST_PREFIX prefix]
[TEST_SUFFIX suffix]
[SKIP_DEPENDENCY]
[TEST_LIST outVar]
)
``gtest_add_tests`` attempts to identify tests by scanning source files.
Although this is generally effective, it uses only a basic regular expression
match, which can be defeated by atypical test declarations, and is unable to
fully "split" parameterized tests. Additionally, it requires that CMake be
re-run to discover any newly added, removed or renamed tests (by default,
this means that CMake is re-run when any test source file is changed, but see
``SKIP_DEPENDENCY``). However, it has the advantage of declaring tests at
CMake time, which somewhat simplifies setting additional properties on tests,
and always works in a cross-compiling environment.
The options are:
``TARGET target``
Specifies the Google Test executable, which must be a known CMake
executable target. CMake will substitute the location of the built
executable when running the test.
``SOURCES src1...``
When provided, only the listed files will be scanned for test cases. If
this option is not given, the :prop_tgt:`SOURCES` property of the
specified ``target`` will be used to obtain the list of sources.
``EXTRA_ARGS arg1...``
Any extra arguments to pass on the command line to each test case.
``WORKING_DIRECTORY dir``
Specifies the directory in which to run the discovered test cases. If this
option is not provided, the current binary directory is used.
``TEST_PREFIX prefix``
Specifies a ``prefix`` to be prepended to the name of each discovered test
case. This can be useful when the same source files are being used in
multiple calls to ``gtest_add_test()`` but with different ``EXTRA_ARGS``.
``TEST_SUFFIX suffix``
Similar to ``TEST_PREFIX`` except the ``suffix`` is appended to the name of
every discovered test case. Both ``TEST_PREFIX`` and ``TEST_SUFFIX`` may
be specified.
``SKIP_DEPENDENCY``
Normally, the function creates a dependency which will cause CMake to be
re-run if any of the sources being scanned are changed. This is to ensure
that the list of discovered tests is updated. If this behavior is not
desired (as may be the case while actually writing the test cases), this
option can be used to prevent the dependency from being added.
``TEST_LIST outVar``
The variable named by ``outVar`` will be populated in the calling scope
with the list of discovered test cases. This allows the caller to do
things like manipulate test properties of the discovered tests.
.. code-block:: cmake
include(GoogleTest)
add_executable(FooTest FooUnitTest.cxx)
gtest_add_tests(TARGET FooTest
TEST_SUFFIX .noArgs
TEST_LIST noArgsTests
)
gtest_add_tests(TARGET FooTest
EXTRA_ARGS --someArg someValue
TEST_SUFFIX .withArgs
TEST_LIST withArgsTests
)
set_tests_properties(${noArgsTests} PROPERTIES TIMEOUT 10)
set_tests_properties(${withArgsTests} PROPERTIES TIMEOUT 20)
For backward compatibility, the following form is also supported::
gtest_add_tests(exe args files...)
``exe``
The path to the test executable or the name of a CMake target.
``args``
A ;-list of extra arguments to be passed to executable. The entire
list must be passed as a single argument. Enclose it in quotes,
or pass ``""`` for no arguments.
``files...``
A list of source files to search for tests and test fixtures.
Alternatively, use ``AUTO`` to specify that ``exe`` is the name
of a CMake executable target whose sources should be scanned.
.. code-block:: cmake
include(GoogleTest)
set(FooTestArgs --foo 1 --bar 2)
add_executable(FooTest FooUnitTest.cxx)
gtest_add_tests(FooTest "${FooTestArgs}" AUTO)
.. command:: gtest_discover_tests
Automatically add tests with CTest by querying the compiled test executable
for available tests::
gtest_discover_tests(target
[EXTRA_ARGS arg1...]
[WORKING_DIRECTORY dir]
[TEST_PREFIX prefix]
[TEST_SUFFIX suffix]
[NO_PRETTY_TYPES] [NO_PRETTY_VALUES]
[PROPERTIES name1 value1...]
[TEST_LIST var]
[DISCOVERY_TIMEOUT seconds]
[XML_OUTPUT_DIR dir]
[DISCOVERY_MODE <POST_BUILD|PRE_TEST>]
)
``gtest_discover_tests()`` sets up a post-build command on the test executable
that generates the list of tests by parsing the output from running the test
with the ``--gtest_list_tests`` argument. Compared to the source parsing
approach of :command:`gtest_add_tests`, this ensures that the full list of
tests, including instantiations of parameterized tests, is obtained. Since
test discovery occurs at build time, it is not necessary to re-run CMake when
the list of tests changes.
However, it requires that :prop_tgt:`CROSSCOMPILING_EMULATOR` is properly set
in order to function in a cross-compiling environment.
Additionally, setting properties on tests is somewhat less convenient, since
the tests are not available at CMake time. Additional test properties may be
assigned to the set of tests as a whole using the ``PROPERTIES`` option. If
more fine-grained test control is needed, custom content may be provided
through an external CTest script using the :prop_dir:`TEST_INCLUDE_FILES`
directory property. The set of discovered tests is made accessible to such a
script via the ``<target>_TESTS`` variable.
The options are:
``target``
Specifies the Google Test executable, which must be a known CMake
executable target. CMake will substitute the location of the built
executable when running the test.
``EXTRA_ARGS arg1...``
Any extra arguments to pass on the command line to each test case.
``WORKING_DIRECTORY dir``
Specifies the directory in which to run the discovered test cases. If this
option is not provided, the current binary directory is used.
``TEST_PREFIX prefix``
Specifies a ``prefix`` to be prepended to the name of each discovered test
case. This can be useful when the same test executable is being used in
multiple calls to ``gtest_discover_tests()`` but with different
``EXTRA_ARGS``.
``TEST_SUFFIX suffix``
Similar to ``TEST_PREFIX`` except the ``suffix`` is appended to the name of
every discovered test case. Both ``TEST_PREFIX`` and ``TEST_SUFFIX`` may
be specified.
``NO_PRETTY_TYPES``
By default, the type index of type-parameterized tests is replaced by the
actual type name in the CTest test name. If this behavior is undesirable
(e.g. because the type names are unwieldy), this option will suppress this
behavior.
``NO_PRETTY_VALUES``
By default, the value index of value-parameterized tests is replaced by the
actual value in the CTest test name. If this behavior is undesirable
(e.g. because the value strings are unwieldy), this option will suppress
this behavior.
``PROPERTIES name1 value1...``
Specifies additional properties to be set on all tests discovered by this
invocation of ``gtest_discover_tests()``.
``TEST_LIST var``
Make the list of tests available in the variable ``var``, rather than the
default ``<target>_TESTS``. This can be useful when the same test
executable is being used in multiple calls to ``gtest_discover_tests()``.
Note that this variable is only available in CTest.
``DISCOVERY_TIMEOUT num``
Specifies how long (in seconds) CMake will wait for the test to enumerate
available tests. If the test takes longer than this, discovery (and your
build) will fail. Most test executables will enumerate their tests very
quickly, but under some exceptional circumstances, a test may require a
longer timeout. The default is 5. See also the ``TIMEOUT`` option of
:command:`execute_process`.
.. note::
In CMake versions 3.10.1 and 3.10.2, this option was called ``TIMEOUT``.
This clashed with the ``TIMEOUT`` test property, which is one of the
common properties that would be set with the ``PROPERTIES`` keyword,
usually leading to legal but unintended behavior. The keyword was
changed to ``DISCOVERY_TIMEOUT`` in CMake 3.10.3 to address this
problem. The ambiguous behavior of the ``TIMEOUT`` keyword in 3.10.1
and 3.10.2 has not been preserved.
``XML_OUTPUT_DIR dir``
If specified, the parameter is passed along with ``--gtest_output=xml:``
to test executable. The actual file name is the same as the test target,
including prefix and suffix. This should be used instead of
``EXTRA_ARGS --gtest_output=xml`` to avoid race conditions writing the
XML result output when using parallel test execution.
``DISCOVERY_MODE``
Provides greater control over when ``gtest_discover_tests()`` performs test
discovery. By default, ``POST_BUILD`` sets up a post-build command
to perform test discovery at build time. In certain scenarios, like
cross-compiling, this ``POST_BUILD`` behavior is not desirable.
By contrast, ``PRE_TEST`` delays test discovery until just prior to test
execution. This way test discovery occurs in the target environment
where the test has a better chance at finding appropriate runtime
dependencies.
``DISCOVERY_MODE`` defaults to the value of the
``CMAKE_GTEST_DISCOVER_TESTS_DISCOVERY_MODE`` variable if it is not
passed when calling ``gtest_discover_tests()``. This provides a mechanism
for globally selecting a preferred test discovery behavior without having
to modify each call site.
#]=======================================================================]
# Save project's policies
cmake_policy(PUSH)
cmake_policy(SET CMP0057 NEW) # if IN_LIST
#------------------------------------------------------------------------------
function(gtest_add_tests)
if (ARGC LESS 1)
message(FATAL_ERROR "No arguments supplied to gtest_add_tests()")
endif()
set(options
SKIP_DEPENDENCY
)
set(oneValueArgs
TARGET
WORKING_DIRECTORY
TEST_PREFIX
TEST_SUFFIX
TEST_LIST
)
set(multiValueArgs
SOURCES
EXTRA_ARGS
)
set(allKeywords ${options} ${oneValueArgs} ${multiValueArgs})
unset(sources)
if("${ARGV0}" IN_LIST allKeywords)
cmake_parse_arguments(ARGS "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
set(autoAddSources YES)
else()
# Non-keyword syntax, convert to keyword form
if (ARGC LESS 3)
message(FATAL_ERROR "gtest_add_tests() without keyword options requires at least 3 arguments")
endif()
set(ARGS_TARGET "${ARGV0}")
set(ARGS_EXTRA_ARGS "${ARGV1}")
if(NOT "${ARGV2}" STREQUAL "AUTO")
set(ARGS_SOURCES "${ARGV}")
list(REMOVE_AT ARGS_SOURCES 0 1)
endif()
endif()
# The non-keyword syntax allows the first argument to be an arbitrary
# executable rather than a target if source files are also provided. In all
# other cases, both forms require a target.
if(NOT TARGET "${ARGS_TARGET}" AND NOT ARGS_SOURCES)
message(FATAL_ERROR "${ARGS_TARGET} does not define an existing CMake target")
endif()
if(NOT ARGS_WORKING_DIRECTORY)
unset(workDir)
else()
set(workDir WORKING_DIRECTORY "${ARGS_WORKING_DIRECTORY}")
endif()
if(NOT ARGS_SOURCES)
get_property(ARGS_SOURCES TARGET ${ARGS_TARGET} PROPERTY SOURCES)
endif()
unset(testList)
set(gtest_case_name_regex ".*\\( *([A-Za-z_0-9]+) *, *([A-Za-z_0-9]+) *\\).*")
set(gtest_test_type_regex "(TYPED_TEST|TEST_?[FP]?)")
foreach(source IN LISTS ARGS_SOURCES)
if(NOT ARGS_SKIP_DEPENDENCY)
set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${source})
endif()
file(READ "${source}" contents)
string(REGEX MATCHALL "${gtest_test_type_regex} *\\(([A-Za-z_0-9 ,]+)\\)" found_tests "${contents}")
foreach(hit ${found_tests})
string(REGEX MATCH "${gtest_test_type_regex}" test_type ${hit})
# Parameterized tests have a different signature for the filter
if("x${test_type}" STREQUAL "xTEST_P")
string(REGEX REPLACE ${gtest_case_name_regex} "*/\\1.\\2/*" gtest_test_name ${hit})
elseif("x${test_type}" STREQUAL "xTEST_F" OR "x${test_type}" STREQUAL "xTEST")
string(REGEX REPLACE ${gtest_case_name_regex} "\\1.\\2" gtest_test_name ${hit})
elseif("x${test_type}" STREQUAL "xTYPED_TEST")
string(REGEX REPLACE ${gtest_case_name_regex} "\\1/*.\\2" gtest_test_name ${hit})
else()
message(WARNING "Could not parse GTest ${hit} for adding to CTest.")
continue()
endif()
# Make sure tests disabled in GTest get disabled in CTest
if(gtest_test_name MATCHES "(^|\\.)DISABLED_")
# Add the disabled test if CMake is new enough
# Note that this check is to allow backwards compatibility so this
# module can be copied locally in projects to use with older CMake
# versions
if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.8.20170401)
string(REGEX REPLACE
"(^|\\.)DISABLED_" "\\1"
orig_test_name "${gtest_test_name}"
)
set(ctest_test_name
${ARGS_TEST_PREFIX}${orig_test_name}${ARGS_TEST_SUFFIX}
)
add_test(NAME ${ctest_test_name}
${workDir}
COMMAND ${ARGS_TARGET}
--gtest_also_run_disabled_tests
--gtest_filter=${gtest_test_name}
${ARGS_EXTRA_ARGS}
)
set_tests_properties(${ctest_test_name} PROPERTIES DISABLED TRUE)
list(APPEND testList ${ctest_test_name})
endif()
else()
set(ctest_test_name ${ARGS_TEST_PREFIX}${gtest_test_name}${ARGS_TEST_SUFFIX})
add_test(NAME ${ctest_test_name}
${workDir}
COMMAND ${ARGS_TARGET}
--gtest_filter=${gtest_test_name}
${ARGS_EXTRA_ARGS}
)
list(APPEND testList ${ctest_test_name})
endif()
endforeach()
endforeach()
if(ARGS_TEST_LIST)
set(${ARGS_TEST_LIST} ${testList} PARENT_SCOPE)
endif()
endfunction()
#------------------------------------------------------------------------------
function(gtest_discover_tests TARGET)
cmake_parse_arguments(
""
"NO_PRETTY_TYPES;NO_PRETTY_VALUES"
"TEST_PREFIX;TEST_SUFFIX;WORKING_DIRECTORY;TEST_LIST;DISCOVERY_TIMEOUT;XML_OUTPUT_DIR;DISCOVERY_MODE"
"EXTRA_ARGS;PROPERTIES"
${ARGN}
)
if(NOT _WORKING_DIRECTORY)
set(_WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}")
endif()
if(NOT _TEST_LIST)
set(_TEST_LIST ${TARGET}_TESTS)
endif()
if(NOT _DISCOVERY_TIMEOUT)
set(_DISCOVERY_TIMEOUT 5)
endif()
if(NOT _DISCOVERY_MODE)
if(NOT CMAKE_GTEST_DISCOVER_TESTS_DISCOVERY_MODE)
set(CMAKE_GTEST_DISCOVER_TESTS_DISCOVERY_MODE "POST_BUILD")
endif()
set(_DISCOVERY_MODE ${CMAKE_GTEST_DISCOVER_TESTS_DISCOVERY_MODE})
endif()
get_property(
has_counter
TARGET ${TARGET}
PROPERTY CTEST_DISCOVERED_TEST_COUNTER
SET
)
if(has_counter)
get_property(
counter
TARGET ${TARGET}
PROPERTY CTEST_DISCOVERED_TEST_COUNTER
)
math(EXPR counter "${counter} + 1")
else()
set(counter 1)
endif()
set_property(
TARGET ${TARGET}
PROPERTY CTEST_DISCOVERED_TEST_COUNTER
${counter}
)
# Define rule to generate test list for aforementioned test executable
# Blender: use _ instead of [] to avoid problems with zsh regex.
set(ctest_file_base "${CMAKE_CURRENT_BINARY_DIR}/${TARGET}_${counter}_")
set(ctest_include_file "${ctest_file_base}_include.cmake")
set(ctest_tests_file "${ctest_file_base}_tests.cmake")
get_property(crosscompiling_emulator
TARGET ${TARGET}
PROPERTY CROSSCOMPILING_EMULATOR
)
if(_DISCOVERY_MODE STREQUAL "POST_BUILD")
add_custom_command(
TARGET ${TARGET} POST_BUILD
BYPRODUCTS "${ctest_tests_file}"
COMMAND "${CMAKE_COMMAND}"
-D "TEST_TARGET=${TARGET}"
-D "TEST_EXECUTABLE=$<TARGET_FILE:${TARGET}>"
-D "TEST_EXECUTOR=${crosscompiling_emulator}"
-D "TEST_WORKING_DIR=${_WORKING_DIRECTORY}"
-D "TEST_EXTRA_ARGS=${_EXTRA_ARGS}"
-D "TEST_PROPERTIES=${_PROPERTIES}"
-D "TEST_PREFIX=${_TEST_PREFIX}"
-D "TEST_SUFFIX=${_TEST_SUFFIX}"
-D "NO_PRETTY_TYPES=${_NO_PRETTY_TYPES}"
-D "NO_PRETTY_VALUES=${_NO_PRETTY_VALUES}"
-D "TEST_LIST=${_TEST_LIST}"
-D "CTEST_FILE=${ctest_tests_file}"
-D "TEST_DISCOVERY_TIMEOUT=${_DISCOVERY_TIMEOUT}"
-D "TEST_XML_OUTPUT_DIR=${_XML_OUTPUT_DIR}"
-P "${_GOOGLETEST_DISCOVER_TESTS_SCRIPT}"
VERBATIM
)
file(WRITE "${ctest_include_file}"
"if(EXISTS \"${ctest_tests_file}\")\n"
" include(\"${ctest_tests_file}\")\n"
"else()\n"
" add_test(${TARGET}_NOT_BUILT ${TARGET}_NOT_BUILT)\n"
"endif()\n"
)
elseif(_DISCOVERY_MODE STREQUAL "PRE_TEST")
get_property(GENERATOR_IS_MULTI_CONFIG GLOBAL
PROPERTY GENERATOR_IS_MULTI_CONFIG
)
if(GENERATOR_IS_MULTI_CONFIG)
set(ctest_tests_file "${ctest_file_base}_tests-$<CONFIG>.cmake")
endif()
string(CONCAT ctest_include_content
"if(EXISTS \"$<TARGET_FILE:${TARGET}>\")" "\n"
" if(\"$<TARGET_FILE:${TARGET}>\" IS_NEWER_THAN \"${ctest_tests_file}\")" "\n"
" include(\"${_GOOGLETEST_DISCOVER_TESTS_SCRIPT}\")" "\n"
" gtest_discover_tests_impl(" "\n"
" TEST_EXECUTABLE" " [==[" "$<TARGET_FILE:${TARGET}>" "]==]" "\n"
" TEST_EXECUTOR" " [==[" "${crosscompiling_emulator}" "]==]" "\n"
" TEST_WORKING_DIR" " [==[" "${_WORKING_DIRECTORY}" "]==]" "\n"
" TEST_EXTRA_ARGS" " [==[" "${_EXTRA_ARGS}" "]==]" "\n"
" TEST_PROPERTIES" " [==[" "${_PROPERTIES}" "]==]" "\n"
" TEST_PREFIX" " [==[" "${_TEST_PREFIX}" "]==]" "\n"
" TEST_SUFFIX" " [==[" "${_TEST_SUFFIX}" "]==]" "\n"
" NO_PRETTY_TYPES" " [==[" "${_NO_PRETTY_TYPES}" "]==]" "\n"
" NO_PRETTY_VALUES" " [==[" "${_NO_PRETTY_VALUES}" "]==]" "\n"
" TEST_LIST" " [==[" "${_TEST_LIST}" "]==]" "\n"
" CTEST_FILE" " [==[" "${ctest_tests_file}" "]==]" "\n"
" TEST_DISCOVERY_TIMEOUT" " [==[" "${_DISCOVERY_TIMEOUT}" "]==]" "\n"
" TEST_XML_OUTPUT_DIR" " [==[" "${_XML_OUTPUT_DIR}" "]==]" "\n"
" )" "\n"
" endif()" "\n"
" include(\"${ctest_tests_file}\")" "\n"
"else()" "\n"
" add_test(${TARGET}_NOT_BUILT ${TARGET}_NOT_BUILT)" "\n"
"endif()" "\n"
)
if(GENERATOR_IS_MULTI_CONFIG)
foreach(_config ${CMAKE_CONFIGURATION_TYPES})
file(GENERATE OUTPUT "${ctest_file_base}_include-${_config}.cmake" CONTENT "${ctest_include_content}" CONDITION $<CONFIG:${_config}>)
endforeach()
file(WRITE "${ctest_include_file}" "include(\"${ctest_file_base}_include-\${CTEST_CONFIGURATION_TYPE}.cmake\")")
else()
file(GENERATE OUTPUT "${ctest_file_base}_include.cmake" CONTENT "${ctest_include_content}")
file(WRITE "${ctest_include_file}" "include(\"${ctest_file_base}_include.cmake\")")
endif()
else()
message(FATAL_ERROR "Unknown DISCOVERY_MODE: ${_DISCOVERY_MODE}")
endif()
# Add discovered tests to directory TEST_INCLUDE_FILES
set_property(DIRECTORY
APPEND PROPERTY TEST_INCLUDE_FILES "${ctest_include_file}"
)
endfunction()
###############################################################################
set(_GOOGLETEST_DISCOVER_TESTS_SCRIPT
${CMAKE_CURRENT_LIST_DIR}/GTestAddTests.cmake
)
# Restore project's policies
cmake_policy(POP)

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