Commit Graph

102904 Commits

Author SHA1 Message Date
Campbell Barton
e0a4b392f3 Cleanup: use exact check for fread, move out of the loop
Without this, additional items could be added in the future
which wouldn't be included in the check.

Move the check out of the loop since this is such an unlikely
situation that checking every iteration isn't needed.

Also remove redundant casts.
2021-01-12 23:31:34 +11:00
Campbell Barton
28b17ef0e6 Cleanup: replace 'long long' with int64_t in imbuf indexer 2021-01-12 23:31:34 +11:00
Jacques Lucke
3b77bd48f9 Geometry Nodes: new Align Rotation to Vector node
This adds a new Align Rotation to Vector node based on the mockup
in T83669.

Reviewers: HooglyBoogly, simonthommes

Differential Revision: https://developer.blender.org/D10081
2021-01-12 12:55:14 +01:00
Jacques Lucke
3a254b93fd Geometry Nodes: support reading from spans of WriteAttribute
Previously, the span returned by `WriteAttribute`s might not contain the
current value of the attribute for performance reasons. To avoid some
bugs, the span now always contains the old values (they might have to
be copied over from the internal storage, dependending on how the
attribute is stored).
The old behavior is still available with the `get_span_for_write_only`
method. The span that it returns might not contain the current
attribute values. Therefore, it should only be used when you want
to overwrite an attribute without looking at the old values.
2021-01-12 12:50:29 +01:00
Alexander Gavrilov
58dae919e5 Weight Paint: avoid creating very small values with locked weights.
When painting using Auto-Normalize or Lock Relative with some
groups locked, the locked weights may not add up precisely to
1 because of precision limitations, which results in creating
nonzero weights close to FLT_EPSILON. With Lock Relative display
mode this is very obvious and annoying (random red points amid
black or blue), so add an epsilon check to consider less than
1e-6 unlocked weight to be the same as 0.

In addition, in cases when no weight can be painted due to locks,
don't create vertex group entries at all if they don't exist yet.
Also, don't run Auto Normalize when not painting a deform group.

Differential Revision: https://developer.blender.org/D10000
2021-01-12 14:32:05 +03:00
Robert Guetzkow
f5c0ef52cf Fix T84588: Cache access in rna_Particle_uv_on_emitter
The function `rna_Particle_uv_on_emitter` did not handle the case where
`particle->num_dmcache` was `DMCACHE_ISCHILD`. This resulted in an
incorrect offset for the `mtface` pointer. The commit checks for the
case and sets the offset accordingly, similar to existing code in
e.g. `particle_calculate_parent_uvs`.

Reviewed By: JacquesLucke

Differential Revision: https://developer.blender.org/D10072
2021-01-12 12:14:34 +01:00
Omar Emara
c56da67716 Fix: Bmesh from_object applies modifiers twice
The Bmesh from_object method applies modifiers twice when the input
deform is enabled and the input depsgraph is a render one.

The evaluated object already have modifiers applied, and
mesh_create_eval_final() applies modifiers again. To fix this, the
BKE_mesh_new_from_object() function is used instead.

Reviewed By: Brecht

Differential Revision: https://developer.blender.org/D10053
2021-01-12 13:07:12 +02:00
Bastien Montagne
26fd55fad1 UndoSys: Refactor step 1: cleanup and simplify logic in main undo/redo handlers.
* Simplify and clarify logic in `BKE_undosys_step_undo/redo_with_data_ex`,
  by adding early return on invalid situations, renaming some variables,
  and adding comments.
* Add more sanity checks in those functions.

No behavioral change are expected here, besides in potential edge-case,
invalid situations.

This is a preliminary change, before some deeper modifications of
`BKE_undosys` undo/redo API.

Differential Revision: https://developer.blender.org/D10033
2021-01-12 11:58:14 +01:00
Brecht Van Lommel
1dc9650d20 Cycles: upgrade to OptiX SDK version 7.1 on buildbot
This means that NVIDIA driver version 450 or newer is now required for Cycles
OptiX rendering. This upgrade is required to take advantage of new features and
improvements.

Ref T81431
2021-01-12 11:51:42 +01:00
Bastien Montagne
89ae4a7a2a Fix NLA liboverride issues re tracks handling.
From original rBc0bd240ad0a1 commit, issues reported with suggested
fixes by Wayde Moss (@GuiltyGhost), thx.
2021-01-12 11:32:17 +01:00
Oliver Weissbarth
401279253e Fix T84515: Status bar is reporting the average solve error of the wrong tracking object
Reviewed By: sergey

Maniphest Tasks: T84515

Differential Revision: https://developer.blender.org/D10047
2021-01-12 11:02:12 +01:00
Janusch Patas
2a23addf52 Fix T83122: NURBS Extruding multiple points only moves existing points
The Surface -> Nurbs Curve behaves now like the Curve -> Nurbs Curve,
if you initially select less than all points. So, multiple points can
be selected and extruded which just moves the selected points similar
to Curve -> Nurbs Curve object.

Differential Revision: https://developer.blender.org/D9934
2021-01-12 10:56:51 +01:00
Philipp Oeser
ff51afb194 Fix T84593: Operators on material (linked to local object but with
linked obdata) fail

Caused by rB1a650fdcb286.

Above commit made polling more restricitive in that it did not allow for
actions on material slots (linked to object, not object data) on objects
with liked object data. This should be allowed though.

Maniphest Tasks: T84593

https://developer.blender.org/D10078
2021-01-12 10:03:48 +01:00
Campbell Barton
55059af01d Fix T84455: Circle select tool cursor draws in overlapping regions 2021-01-12 14:19:32 +11:00
Rahul Chaudhary
acbda123ad UI: Icon for Multires Displacement Smear Tool
This commit adds the icon for the new tool.
2021-01-11 15:30:26 -06:00
Hans Goudey
b9b59aa6de UI: Update geometry icon files
None of these changes should be visible, but the files were somehow
out of sync with the blend file, so they need to be updated to reflect
those changes.
2021-01-11 15:29:20 -06:00
Lukas Stockner
688e5c6d38 Fix T82351: Cycles: Tile stealing glitches with adaptive sampling
In my testing this works, but it requires me to remove the min(start_sample...) part in the
adaptive sampling kernel, and I assume there's a reason why it was there?

Reviewed By: brecht

Maniphest Tasks: T82351

Differential Revision: https://developer.blender.org/D9445
2021-01-11 21:04:49 +01:00
Lukas Stockner
b70f4a265a Fix T84496: Cycles: Tile stealing does not work with NLM
Reviewed By: brecht

Maniphest Tasks: T84496

Differential Revision: https://developer.blender.org/D10066
2021-01-11 21:04:49 +01:00
Nicholas Rishel
d5c59913de Fix T81211 Add high frequency mouse input for Windows.
Also send mouse move event instead of moving cursor via SetCursorPos.
SetCursorPos did not reliably move the mouse when it is leaving the
window quickly.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D9981
2021-01-11 11:40:21 -08:00
Hans Goudey
ecdbd83a8d Geometry Nodes: Attribute Vector Math Node
This patch implements the same operations and interface as the regular
vector math node, but it runs for every element of the attribute. This
should expand what's possible with geometry nodes quite a bit.

Differential Revision: https://developer.blender.org/D9914
2021-01-11 12:06:52 -06:00
Hans Goudey
5bd822dc46 Geometry Nodes Point Distribution: Align points to face normals
This patch makes the point distribute node write to the "rotation"
attribute with the normal of each face at each distributed point.
The "normal" attribute is also created with the triangle normal
at each point.

The conversion from the triangle normal to an Euler rotation is somewhat
arbitrary, since we only have one direction vector. For a more flexible
rotation for each point, the "Align Rotation to Vector" node can be used
in the future.

Differential Revision: https://developer.blender.org/D9965
2021-01-11 11:42:16 -06:00
Bastien Montagne
2a8b987e9e Fix T83422: Dimensions incorrect after undoing if it has modified geometry.
Root of the issue is that `BKE_object_eval_boundbox` (that ports back
evaluated bbox to orig object during active depsgraph evaluation) is
only called when object's geometry actually is evaluated.

However, with new undo, often Object itself can be changed by undo,
without requiring its geometry to be re-evaluated, which was leading to
the evaluated bbox not being copied back into orig object anymore.

Fixing that by moving bbox copying-to-orig code into
`BKE_object_sync_to_original` instead, which is always executed when
object is evaluated (as hinted by the comment above
`BKE_object_eval_boundbox` actually).

Also allows to cleanup code for armature eval, apparently.

Maniphest Tasks: T83422

Differential Revision: https://developer.blender.org/D9789
2021-01-11 17:59:21 +01:00
Alexander Gavrilov
e44e0e4e78 Cloth: add a vertex group setting to exclude from object collision.
This can be useful as a workaround on the boundary with the pinned
vertices in some situations among other things, and completely copies
the existing design of the self collision vertex group setting.

Differential Revision: https://developer.blender.org/D10043
2021-01-11 19:34:33 +03:00
Alexander Gavrilov
ac290bfbe4 Collision: allow disabling collision without removing the modifier.
The `object.collision.use` flag was treated as a redundant marker
of the existence of the modifier, going as far as adding/removing
it when the value was changed, which is not actually very useful.
Removing the modifier loses its position in the stack, and requires
a dependency graph rebuild. It feels it may be a legacy flag?

What would be useful however is the ability to toggle collisions
dynamically without removing the modifier. This patch adjusts the
code to keep the modifier when the flag is disabled, and add it
if it doesn't exist when the flag is enabled. The modifier now
checks the flag at the start and quickly exits after cleaning
up stale data. The redesigned setting is exposed in the UI.

Collisions can't be disabled by simply using the modifier enable
flags because the modifier merely saves a snapshot of the mesh at
a certain point of the modifier stack for other objects to use,
and thus has to be able to clear the stale data.

Differential Revision: https://developer.blender.org/D10064
2021-01-11 19:34:32 +03:00
b271475a9e ImBuf: Add error handling to IMB_indexer_open
Handle return value of `fread()` by printing an error and closing the
file when it cannot be read from. Not only is error handing a good idea,
it also prevents GCC from warning that the return value of `fread()`
should not be ignored:

```
.../blender/source/blender/imbuf/intern/indexer.c: In function ‘IMB_indexer_open’:
.../blender/source/blender/imbuf/intern/indexer.c:201:5: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Wunused-result]
  201 |     fread(&idx->entries[i].frameno, sizeof(int), 1, fp);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.../blender/source/blender/imbuf/intern/indexer.c:202:5: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Wunused-result]
  202 |     fread(&idx->entries[i].seek_pos, sizeof(unsigned long long), 1, fp);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.../blender/source/blender/imbuf/intern/indexer.c:203:5: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Wunused-result]
  203 |     fread(&idx->entries[i].seek_pos_dts, sizeof(unsigned long long), 1, fp);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.../blender/source/blender/imbuf/intern/indexer.c:204:5: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Wunused-result]
  204 |     fread(&idx->entries[i].pts, sizeof(unsigned long long), 1, fp);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```

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

Reviewed by: campbellbarton
2021-01-11 17:29:21 +01:00
Bastien Montagne
bf90fcda47 ID Creation: generate session_uuid in more cases.
Previous code would not generate a session uuid for embedded IDs (like
root node trees or master collections). While this is not a problem
currently since those are not directly stored in Main data-base, this is
conceptually wrong, since those IDs still pertain the Main data.

Further more, this is blocking using `session_uuid` more in depsgraph in
place from ID pointer itself, as identifier (related to T84397).
2021-01-11 16:44:19 +01:00
Bastien Montagne
1a26d15763 Fix Embedded IDs creation bypassing ID management completely.
No ID (even remotely) related to Main database should ever be created
directly through MEM_mallocN. Using `BKE_libblock_alloc` is the bare
minimum.

Note that there is no behavior change expected here.
2021-01-11 16:44:19 +01:00
Bastien Montagne
2f9073adb1 Fix missing IDType init in ViewLayer tests.
Kinda miracle this did not cause problems so far, but was breaking tests
with some upcoming changes.
2021-01-11 16:44:19 +01:00
Brecht Van Lommel
9e1ec5033d Fix T84516: ID properties have incorrect names in Python dir() list
Caused by not going through the proper accessor function to access the
property identifier.
2021-01-11 16:10:29 +01:00
Jacques Lucke
98268e5c68 Cleanup: remove trailing whitespace 2021-01-11 15:49:42 +01:00
Jacques Lucke
beb5863ed4 Geometry Nodes: transform Object Info outputs to local space
Ref T83670.

Differential Revision: https://developer.blender.org/D10071
2021-01-11 15:00:29 +01:00
Jacques Lucke
c083398921 BLI: fix math operation
That fixes a stupid mistake of mine that was copied a couple of times.
2021-01-11 14:59:05 +01:00
Campbell Barton
7b6e55b933 Cleanup: remove redundant UV edge selection calls
Selecting vertices and faces first checked edge selection,
this was called to set vert1 & vert2 variables which have since been
removed.

These calls should have been removed in
51f04bf7b8ee03a7973c50e525ffa5c67dde5fb7.
2021-01-12 00:53:33 +11:00
Campbell Barton
2a297366f0 Fix T84565: UV face select fails when zoomed in
Exposed by recent commit 246efd7286f6187e4dd4b3edcc79cccb1746bb1d

Although this was an existing logical error causing
`uv_find_nearest_face` to only work properly when the hit distance was
initialized to FLT_MAX, which wasn't the case in multi-object edit mode.
2021-01-12 00:31:54 +11:00
Sebastián Barschkis
fe53b6a7fb Fluid: Adjusted viscosity strength step size in UI
Step size was too small.
2021-01-11 12:55:33 +01:00
Pi Lanningham
f0ae0f490e Fix T84327: outliner_id_copy_tag was only copying from expanded nodes.
If a node was closed in the hierarchy, we would only copy that node,
even if child nodes were selected.

Reviewed By: brecht, mont29

Maniphest Tasks: T84327

Differential Revision: https://developer.blender.org/D9995
2021-01-11 12:02:06 +01:00
Jeroen Bakker
6e7716f32e Cleanup: Added const to RenderLayersProg methods 2021-01-11 11:46:32 +01:00
Richard Antalik
445ebcaa30 VSE: store raw images in cache
Previously raw images were not cached if image wasn't preprocessed.
This caused issue, that image had to be read from disk on every redraw.

Effect strips must be excluded, because this would cause problem with
invalidation. Effect strips can use preprocessing however. This is
mainly to allow usimg modifiers on them.

This change should follow rBf448ff2afe7a77, but I have wrongly assumed,
that it has been implemented already.

ref T80278
2021-01-11 11:38:33 +01:00
54f8a5dd73 Tests: run suites instead of individual test cases
Group all tests of a test suite into a single test command invocation.
This reduces the number of invocations by `ctest` by an order of
magnitude.

Since rB56aa5b0d8c6b663, `bin/tests/blender_test` was run for every
individual test. Having over a 1000 tests made testing slower than
necessary. Individual tests can still be run if desired by invocation of
`bin/tests/blender_test --gtest_filter=suitename.testname`.

NOTE: For this commit to have an immediate effect, it may be necessary
to remove the `tests` and `Testing` directories and some CMake files
from your build directory and rebuild. Run `ctest -N` to see the list of
tests; there should be less than 200.

Reviewed By: sergey, LazyDodo, sebbas

Maniphest Tasks: T83222

Differential Revision: https://developer.blender.org/D9649
2021-01-11 11:29:30 +01:00
Richard Antalik
63cea2b793 Fix versioning code outside of version check
Bug introduced in f448ff2afe7a probably due to mistake when resolving
conflicts and not checking functionality.
2021-01-11 10:55:27 +01:00
Jacques Lucke
d095411002 Fix T83544: Cycles crash when rendering with Save Buffers enabled
The issue is that the "Noisy Image" pass is added even though it should not.

`use_denoising` has to be enabled on the scene and on the view layer
to actually enable it.

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

Reviewers: lukasstockner97, brecht
2021-01-11 10:21:38 +01:00
Jeroen Bakker
4c44a5309c Fix T84459: Face normals not displaying (AMD GPU)
This is part two of the fix for T84459.
Issue appears to be caused by AMD graphics driver later than 20.11.1 and
affects older GPUs (Polaris/FIJI cards). Drawing normals in edit mode
uses the same OpenGL data type for storing normals that is known to be
faulty.

This change fixes the face dot normals by using GPU_COMP_I16.
2021-01-11 09:52:16 +01:00
Jeroen Bakker
618f7df7fc Cleanup: Incorrect comment 2021-01-11 09:52:16 +01:00
Jeroen Bakker
9fb32b2b29 Fix T84459: Wireframe not displaying with AMD GPU
Issue appears to be caused by AMD graphics driver later than 20.11.1 and
affects older GPUs (Polaris/FIJI cards). Wireframe drawing uses the same
OpenGL data type for storing normals what is known to be faulty.

This patch enabled storing the normals using GPU_COMP_I16. It also
solves the normals drawing in edit mode for vertex and loop normals.
2021-01-11 09:52:16 +01:00
Campbell Barton
64929398fb Cleanup: skip accessing sequence strip name/source when hidden 2021-01-11 17:58:08 +11:00
Campbell Barton
a83c67c183 Fix incorrect use of BLI_snprintf in sequencer text concatenation
The start of the text was stepped over without subtracting it's length
(introduced in fad80a95fd08ec87a37f30f0b94a7061d4e382f2).

Replace this logic with BLI_string_join_array to simplify construction.
2021-01-11 17:51:42 +11:00
Campbell Barton
b01e62e399 Fix missing directory separator in image/movie strip identifier 2021-01-11 17:17:10 +11:00
Campbell Barton
16aefea9fa Cleanup: use switch statement for sequence types
Also remove duplicate NULL pointer check and replace
BLI_snprintf with BLI_strncpy.
2021-01-11 17:13:27 +11:00
Campbell Barton
50104b11a1 Fix T84582: WalkNavigation.mouse_speed ignored with tablet
Scale the speed up 4x instead of clamping the value to a minimum of 4.
2021-01-11 16:33:15 +11:00
Nicholas Rishel
ab5986cf3a Fix T84501: Wintab button lag.
Multiple Wintab tablets do not send relative button state when
configured to do so. This causes button events to be delayed until
processed as Win32 button events.

This commit fixes the issue by configuring Wintab to use absolute
button state and tracking changes manually.
2021-01-10 21:18:46 -08:00