Commit Graph

78280 Commits

Author SHA1 Message Date
Bastien Montagne 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
Bastien Montagne a082e49671 Cleanup: remove debug prints. 2020-07-15 18:17:34 +02:00
Jacques Lucke cda6da4957 Fix error in recent commit
Obviously a copy paste error of mine...
2020-07-15 18:14:03 +02:00
Antonio Vazquez 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
Jacques Lucke 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
Jacques Lucke 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
Pablo Dobarro 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
Pablo Dobarro 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
Campbell Barton 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
Germano Cavalcante 44bb73e765 Revert "Cleanup: simplify Weld Modifier logic"
This reverts commit 98b1a716d6.

That commit broke a few modifiers.py tests
(Screw+Weld and a weld merge threshold).

And some pairs may be lost in the first loop.
2020-07-15 08:10:41 -03:00
Jacques Lucke ff2fa59689 Fix T76690: Incorrect liquid particle count displayed
Reviewers: sergey, sebbas

Differential Revision: https://developer.blender.org/D7852
2020-07-15 12:53:05 +02:00
Antonio Vazquez 4e8fc14120 GPencil: Fix name typo error 2020-07-15 12:47:55 +02:00
Sebastian Parborg 7e2ffbfb25 Add missing NULL assignment to D8293
Missed reseting "next_td" in that patch.
Shouldn't have caused any issues in practice, but it is nice to be
extra clear and safe in the code.
2020-07-15 12:36:48 +02:00
Sebastian Parborg 50c6448781 Fix T78909: Curve-edit proportional connected-only broken
Now it calculates the actual distance when traveling along the curve.

I addition to this, it also now supports cyclic curves.

Reviewed By: Campbell

Differential Revision: http://developer.blender.org/D8293
2020-07-15 12:29:45 +02:00
Bastien Montagne 680a81fc49 LibOverride: rework 'make override' 3DView operator.
Removed the 'select main object to override' menu when overriding an
instanced collection, this was no more used anyway.

Added new behavior allowing to select which directly linked collection
to override when trying to override an inderctly linked object. This
allows to link collections without instancing them with an empty object,
select one of their objects, and call override operator.
2020-07-15 11:01:40 +02:00
Campbell Barton eb87b1c8f6 Cleanup: remove assignment from a NULL struct
Quiet ASAN 'member access within null pointer' warning.

While this doesn't crash, access to 'shading'
without checking if the 'v3d' would have.
2020-07-15 15:37:03 +10:00
Campbell Barton e062def3b4 Cleanup: spelling 2020-07-15 13:11:22 +10:00
Campbell Barton 061d76f55c Revert "Cleanup: remove public unused function."
This reverts commit 03c8b048a1.

This commit re-introduced T76837.

While there is a comment explaining why this function is needed,
the naming of the poll function does make this confusing.
The API could be changed to avoid confusion here.
2020-07-15 13:09:06 +10:00
Germano Cavalcante d493fc43bd Fix T78875: Numerical display of delta of translation is not updating in 3d view 2020-07-14 17:45:57 -03:00
Sebastián Barschkis 7f67e3200a Fluid: Fix liquid mesh scaling
Fixes issue with .bobj.gz and .obj mesh files not always being scaled correctly in the viewport.
2020-07-14 22:21:15 +02:00
Germano Cavalcante 98b1a716d6 Cleanup: simplify Weld Modifier logic
The original code to rearrange the weld vertices map was confusing.

It traverses the overlap result multiple times within a loop.

This part of the code has therefore been rethought, simplified and commented.

This also results in a slight improvement in the performance of the modifier.
2020-07-14 15:18:22 -03:00
Sebastián Barschkis dbcc74f801 Fix T77263: Mantaflow: Cache gets deleted at changing upres factor under Particles section.
Moved fluid simulation reset to separate functions based on type.
2020-07-14 18:11:35 +02:00
Jeroen Bakker 0b100e21fb Fix T78704: RenderPass normals disapear when view isn't updated
When the view isn't updated the renderpass thought that it was rendering
the next sample, skipping the conversion from encoded to blender
normals.

This patch resets the current sample when only rendering single sample
layers.

Reviewed By: Clément Foucault

Differential Revision: https://developer.blender.org/D8280
2020-07-14 17:42:15 +02:00
Jeroen Bakker 6cc88e330b Fix T78431: Update mesh_cd_layers_type_ to support 8 bytes.
Sculpt vertex colors changed the `DRW_MeshCDMask` from 4 bytes to 8 bytes, but
the functions assumed it still was 4 bytes. This patch updates the functions and
adds a compile time check.

Reviewed By: Clément Foucault

Differential Revision: https://developer.blender.org/D8215
2020-07-14 17:41:05 +02:00
Sebastian Parborg 2ba1cf4b40 Fix T78880: UV Editor - Match prop edit connected behavior with mesh editing and fix Rip Region double proportional checkbox
This fixes the double prop edit checkbox in the redo menu.

This also makes it so that proportional edit in connected mode now
matches how it behaves in mesh edit mode.

Without this change, ripping in UV edit mode with proportional edit on
would be useless as the UV verts you ripped will still be stuck together
even if they were not connected anymore.

Reviewed By: Campbell

Differential Revision: http://developer.blender.org/D8289
2020-07-14 17:27:48 +02:00
Antonio Vazquez 8e9dd5492a Gpencil: Simplify modifier sample mode minimal vert count fix.
For this mode is possible use strokes of 2 points.

Differential revision: https://developer.blender.org/D8138
2020-07-14 15:59:49 +02:00
Bastien Montagne c8a62e4f50 Cleanup: function name not following its module conventions. 2020-07-14 15:28:08 +02:00
Jacques Lucke 6068f49c33 BLI: remove static assert noexcept move constructors
The move constructor of `mpq_class` from GMP currently
allocates when it is moved. So, it cannot be noexcept.
Since we want to use this type, this static assert cannot
stay there.
2020-07-14 15:23:40 +02:00
Kévin Dietrich 2e8a78f4d1 Fluid bake: fix memory leak when path validation fails
Reviewed By: sebbas

Differential Revision: https://developer.blender.org/D8284
2020-07-14 15:21:08 +02:00
Campbell Barton 78148e20fa Cleanup: remove tab indention 2020-07-14 22:52:50 +10:00
Campbell Barton fa7ace2215 PyAPI: support element multiplication for vector, matrix, quaternions
This was disabled during 2.8x for smooth porting of 2.7x scripts,

Now '@' is used for matrix multiplication,
support '*' to multiple vector elements.

See T56276.
2020-07-14 22:52:50 +10:00
Bastien Montagne e3fd60b182 LibOverride: Outliner: Add an operation to override the selected ID and its parents.
This will override all linked data-blocks in the tree branch leading to
the selected one.
2020-07-14 14:51:13 +02:00
Bastien Montagne 140b26909e LibOverride: Move code tagging reauired dependencies of an override into BKE.
This is fairly generic code that can be re-used in other places.
2020-07-14 14:51:13 +02:00
Germano Cavalcante 1e5ce39156 Fix T78900: Single vertex sliding crashes
As we can see in `initVertSlide_ex`, `sld` can be `NULL`.
`sld` is dereferenced, but can still be `NULL`.
2020-07-14 09:31:05 -03:00
Jacques Lucke 01ec76842f Fix T77766: support animated global gravity toggle
Reviewers: sebbas

Differential Revision: https://developer.blender.org/D8281
2020-07-14 13:47:32 +02:00
Sergey Sharybin 25fc84bf2e Fix wrong vector size functions used in knife tool
Should not use copy_v3_v3 on a 2 element vectors.
2020-07-14 10:43:32 +02:00
Antonio Vazquez 26793d619c GPencil: Cleanup Build modifier and fix potential div by zero errors 2020-07-14 10:26:19 +02:00
Campbell Barton 0fb08b7cc4 Cleanup: sort header, cmake paths 2020-07-14 16:04:18 +10:00
Campbell Barton 93e14e5935 Fix T78883: New bezier curve points to uninitialized memory 2020-07-14 15:53:56 +10:00
Campbell Barton 5338b36fcc Cleanup: spelling 2020-07-14 15:19:52 +10:00
Hans Goudey b818f6b55f Fix T78902: Only check main modifier panel for expansion property
Internally the "show_expanded" property stores the expansion for every
subpanel, but for RNA we should only check the first bit of the flag that
corresponds to the main panel.
2020-07-13 20:10:49 -04:00
Hans Goudey 0b24930541 UI: Add missing row in curve profile template 2020-07-13 17:16:01 -04:00
Germano Cavalcante 37fb586a0b Cleanup: remove unnecessary member
`Kfv-> sco` was being treated as a local variable, and can be
confusing since this value is not updated when navigating the viewport.
2020-07-13 16:10:45 -03:00
Pablo Dobarro 2b5e21fe00 Sculpt: Add extra deform types to Smear
The smear brush was using the stroke direction to slide colors across
the mesh surface (this is called drag in other sculpt tools). Similarly,
other deformations can be included. The most common ones in image
editing are pinch and expand, which can be used to sharpen transitions
between colors.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D8270
2020-07-13 17:53:24 +02:00
Pablo Dobarro eb3f74a0fe Sculpt: Enable color palettes for sculpt vertex colors
Enables the color palette subpanel for brushes that have color
capabilities (only the paint brush for now)

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D8268
2020-07-13 17:51:12 +02:00
Bastien Montagne 8dd2386a68 IDTemplate: Minor tweak to 'make local/override' code.
Only update pointer of the template if we actually changed it...
2020-07-13 17:43:22 +02:00
Bastien Montagne fcc91faf3f Fix (unreported) bad handling of undo for some IDTemplates operations. 2020-07-13 17:03:39 +02:00
Jacques Lucke 91e67c7bda Cleanup: remove some incorrectly placed consts
Clang-tidy reported that those parameters could be const,
but that is not true on windows.
2020-07-13 16:55:39 +02:00
Bastien Montagne 3d587efef2 LibOverride: Cleanup: Remove option to disable library overrides.
Code is mature enough now to not need this anymore, people who do not
want to use liboverrides can just not create them.
2020-07-13 16:45:55 +02:00
Germano Cavalcante 5c8dd2a703 Cleanup: silence warnings 2020-07-13 11:40:21 -03:00