Commit Graph

18377 Commits

Author SHA1 Message Date
Campbell Barton
0c58970da7 Cleanup: spelling 2020-07-07 12:49:13 +10:00
Germano Cavalcante
12817083ec Cleanup: Use the BLI_edgehash API in the sewing simulation of cloths
Also remove the code in the ghash that is no longer used.

This change simplifies the existing code.

Differential Revision: https://developer.blender.org/D8219
2020-07-06 14:44:30 -03:00
Bastien Montagne
ee3eba902a Runtime cache preservation during undo: add support for nodes and embedded IDs. 2020-07-06 16:55:38 +02:00
Sybren A. Stüvel
bfc644dcfb Reduce DupliObject::persistent_id from 16 to 8 items
For historical reasons, `DupliObject::persistent_id` was of size
`2*MAX_DUPLI_RECUR`. These reasons are now gone, and the persistent ID
always gets exactly one array element for every dupli-recursion.

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

Reviewed by: brecht
2020-07-06 16:52:28 +02:00
Bastien Montagne
0b07f9b717 Fix T78608: Memory leak in Material properties: "Data from SCE".
Caused by recent own refactor of cache presevation handling in readfile,
EEVEE's lightcache are weird birds that can also be saved in .blend
files, need a special handling for those 'persistent' caches...
2020-07-06 15:09:39 +02:00
Campbell Barton
99feb10b8b Cleanup: warning, spelling 2020-07-06 23:07:18 +10:00
Campbell Barton
dbe171fb26 Cleanup: spelling, comments 2020-07-06 21:03:45 +10:00
Campbell Barton
4f3045999d Cleanup: warnings, spelling 2020-07-06 17:35:41 +10:00
Antonio Vazquez
9168ea8aab Cleanup: Fix small typo error 2020-07-04 11:15:11 +02:00
Antonio Vazquez
17603816f2 GPencil: Cleanup some comments typo 2020-07-04 11:04:21 +02:00
Sybren A. Stüvel
d2db481dc7 Cleanup: Blendkernel, Clang-Tidy else-after-return fixes (incomplete)
This addresses warnings from Clang-Tidy's `readability-else-after-return`
rule in the `source/blender/blenkernel` module. Not all warnings are
addressed in this commit.

No functional changes.
2020-07-03 18:18:16 +02:00
Bastien Montagne
1bdabd7b4f Move MovieClip to new undo cache management system. 2020-07-03 17:01:21 +02:00
Hans Goudey
53d41e1a6f UI: Use sliders and [0, 1] ranges in ocean modifier
The ocean modifier has two properties that use a [0, 10] hard min and
hard max. The values act as factors though, so it makes more sense to
use sliders and a 0 to 1 range.

This commit also bumps the file subversion to avoid repeatedly applying
the change to the properties' range.

Differential Revision: https://developer.blender.org/D8186
2020-07-03 10:28:13 -04:00
Bastien Montagne
3a59c184b9 Move Scene's cache management during undo to new system. 2020-07-03 16:10:33 +02:00
Hans Goudey
19ff145e66 Clang-Tidy: Enable readability-redundant-control-flow 2020-07-03 09:41:55 -04:00
Bastien Montagne
c9975088a9 Move volume to new cache management system for undo. 2020-07-03 15:28:09 +02:00
Jacques Lucke
2633683b52 Clang-tidy: enable readability-container-size-empty warning
Reviewers: sergey

Differential Revision: https://developer.blender.org/D8197
2020-07-03 14:59:27 +02:00
Jacques Lucke
395b294b61 Cleanup: use nested namespaces 2020-07-03 14:25:20 +02:00
Jacques Lucke
d64803f63b Cleanup: Use trailing underscore for non-public data members
This makes the code conform better with our style guide.
2020-07-03 14:16:02 +02:00
Antonio Vazquez
dfbb13b593 GPencil: Cleanup more comments (cont) 2020-07-03 13:52:04 +02:00
Bastien Montagne
aab41401f9 Move bSound cache handling during undo to new system. 2020-07-03 12:56:21 +02:00
Bastien Montagne
ae5529c848 Cleanup: do not use magic values for enums... 2020-07-03 12:56:21 +02:00
Bastien Montagne
8e0f8bb3e1 New undo cache management: Add Image IDs.
Some notes:
* `Image.cache` acts as some kind of 'main' cache, when it is NULL
  (could not be restored), other caches should also be cleared. Oddly
  enough, previous code was not clearing **all** caches, could not find
  any reason for that behavior, so new code does a full clear.
* `imamap` is still used for Node previews from scenes' compositor,
  however this is actually fully disabled in `direct_link_node()`.
* For render slots we cannot use offsetof as third part of the cache
  key, so we are using a hash of the slot's name instead.

As far as I can tell, this fixes T76989: Visual glitches when undo after
reload multiple images by script (in Material Preview).
2020-07-03 12:56:21 +02:00
Bastien Montagne
6cb796e98e IDTypeInfo: add new callback to loop over all cache pointers of an ID.
Part of D8183, refactoring how we preserve caches across undo steps in
readfile code.
2020-07-03 12:56:21 +02:00
Bastien Montagne
5dda6cefb6 Add key structure and hashing utils for ID caches.
Part of D8183, refactoring how we preserve caches across undo steps in
readfile code.
2020-07-03 12:56:21 +02:00
Antonio Vazquez
a06d95987e GPencil: Cleanup more comments (cont) 2020-07-03 12:55:47 +02:00
Antonio Vazquez
972d1700cd GPencil: Cleanup more comments (cont) 2020-07-03 12:55:47 +02:00
Antonio Vazquez
cdea648117 GPencil: Cleanup move functions to geom from modifier 2020-07-03 11:54:07 +02:00
Antonio Vazquez
2193c37768 GPencil: Cleanup Doxygen comments (cont) 2020-07-03 11:54:07 +02:00
Sebastián Barschkis
b1d3850333 Cleanup: Fluid renaming from old 'manta' naming to new 'fluid' naming
Changed variable names from mmd, mds, mfs, and mes to fmd, fds, ffs, and fes. The author of this commits lights a candle for all the merge conflicts this will cause.
2020-07-03 11:52:08 +02:00
Antonio Vazquez
868d6ba1a7 GPencil: Cleanup Doxygen comments 2020-07-03 11:20:00 +02:00
Clément Foucault
5a13f682ee Fix T77559 Avoid wrong ob->imat leading to several bugs
This fixes T77559 Scale to zero in object mode unable to select
2020-07-03 00:21:56 +02:00
Valentin
f3e4a3473e Cleanup: Remove useless duplicated lines
I spotted a duplicate struct declaration, so I had to check for other duplicated as well
There might be some other but i am not confident enough for deleting them

this regex search for duplicate ^(.*;)$\n(\1)$

Reviewed By: JacquesLucke

Differential Revision: https://developer.blender.org/D8146
2020-07-02 16:36:39 -04:00
Sebastián Barschkis
fb0f0f4d79 Fluid: Added offset to control frame range
Added an offset field to control when to load the simulation files. Since this is a very small but helpful addition it is in my view safe to commit at this point of the bcon cycle.
2020-07-02 16:31:35 +02:00
Campbell Barton
945d0269e3 Fix crash calculating vertex parent in edit-mode
Regression in deaff945d0.
2020-07-02 19:12:54 +10:00
Antonio Vazquez
22197d7f8a Fix T76886: GPencil - Flickering when use Background or Camera image
The problem was if some stroke was empty and the changed flag was set to the last stroke wrongly.
2020-07-02 09:29:30 +02:00
Alexander Gavrilov
2788b0261c Cloth: use the original vertex positions to build internal springs.
In order to ensure correct operation of the rest shape key feature,
it's necessary to create a temporary copy of the mesh with rest
vertex positions to run the BVH lookup on. If the rest shape key
isn't used, there is no need for additional overhead.
2020-07-01 18:16:44 +03:00
Brecht Van Lommel
b5660f71fe Fix missing GPU image free in background mode
This is legacy code from before Eevee and Workbench rendering in background
mode was supported. Avoid memory leak by only queueing GPU textures to be
freed when we know they have been allocated.

Differential Revision: https://developer.blender.org/D8172
2020-07-01 16:05:54 +02:00
Alexander Gavrilov
23cc2a2628 Fix ID reference counting asserts when freeing COW pose channels.
Take the do_id_user flag into account when freeing custom properties
attached to pose channels, so that pointer properties don't cause
assertion failures when DEG frees its COW instances.
2020-07-01 14:42:55 +03:00
Jacques Lucke
8d3c4aa2d7 Nodes: add utility method to access bsocket 2020-07-01 09:33:35 +02:00
Campbell Barton
36d6aa428f Cleanup: spelling 2020-07-01 13:12:24 +10:00
Pablo Dobarro
a3e6b7c2ce Sculpt: Refactor persistent base to make it usable from other tools
This renames the layer persistent base and adds new API functions to get
the mesh state from the base, so it can be used from other tools and
replaced in the future with a better system.

Reviewed By: sergey

Maniphest Tasks: T77738

Differential Revision: https://developer.blender.org/D8003
2020-06-30 22:02:17 +02:00
Jacques Lucke
9693163e2f Pointcache: store owner_id instead of object in PTCacheID
The new simulation type can also reference a point cache, but it is not an object.

Reviewers: brecht

Differential Revision: https://developer.blender.org/D8097
2020-06-30 18:25:08 +02:00
Jacques Lucke
5c9c3a3234 Nodes: add some utility methods to DerivedNodeTree 2020-06-30 18:18:47 +02:00
Pablo Dobarro
438bd82371 Sculpt: Pose Brush option to affect loose parts
This option allows posing meshes with different disconnected elements
using the Pose Brush.

This is achieved by doing the following:
- Creating an ID per vertex that stores the connected component of that vertex.
- By using those IDs, one fake topology connection is created per vertex to the nearest vertex in a different ID. The maximum distance to create that connection is determined by the "Max Element Distance" property. These fake connectivity neighbors are used in the Sculpt API functions iterators, so all the algorithms of the Pose Brush can run without modifications as if everything was part of the same mesh.

In order to make this work, the "Connected only" property of the Pose Brush needs to be disabled. This will add an extra performance cost to the Pose Brush and its preview. To achieve optimal results, max element distance should be as low as possible.

Reviewed By: sergey, campbellbarton

Differential Revision: https://developer.blender.org/D7282
2020-06-30 17:43:37 +02:00
Jacques Lucke
84901f2eda Nodes: store nodes by bNodeType instead of idname
This is more efficient in most cases.
2020-06-30 13:35:45 +02:00
Bastien Montagne
a94a05ec19 LibOverride: Add proper handling of shapekeys to core override code itself. 2020-06-30 12:19:11 +02:00
Bastien Montagne
deb01eb199 LibOverride: Add concept of 'embedded'/'virtual' override.
IDs like embedded ones (master collections, root node trees) cannot be
linked, and thus cannot be real override themselves.

Since they are managed by their owner ID, that one will also have the
overrides for their locally edited properties.

We still need a way to mark them as overridden though, for various UI
and override-internal purposes, this is done using a new ID flag.

Note that since Shae Keys are not linkable, and their pointers are not
editable in RNA, they are also considered as embedded from override
point of view.
2020-06-30 12:19:11 +02:00
Bastien Montagne
906d93110e Cleanup: LibOverride: Naming. 2020-06-30 12:19:11 +02:00
Bastien Montagne
fa7d990f10 LibOverride: Fix improper update of depsgraph relations. 2020-06-30 12:19:11 +02:00