Commit Graph

102883 Commits

Author SHA1 Message Date
Campbell Barton
d7cfee0b68 Fix use of uninitialized variable in image sequence detection
Uninitialized stack memory was being re-used in a loop.

Error in original commit from 04f81c8225f28ba9722cc06dc7f2d8a4d72a3fa3

This happened to work as the same memory location was re-used
between iterations and not overwritten.
2021-01-21 14:59:40 +11:00
Campbell Barton
eaf5ee8981 Cleanup: NULL used for boolean 2021-01-21 14:05:16 +11:00
Brecht Van Lommel
c60c30205d Fix T82966, T78152: Cycles GPU render hair ribbon artifacts and differences
Now it should match CPU rendering much more closely.
2021-01-20 19:59:43 +01:00
Sebastian Parborg
b33d839162 Fix T84867: Transform node does not rotate/scale instances
The manipulation of rot/scale was simply not implemented.
2021-01-20 18:17:25 +01:00
Habib Gahbiche
a823e825c8 Fix T84569: crash when trying to bake an object with no faces
Differential Revision: https://developer.blender.org/D10125
2021-01-20 18:07:51 +01:00
Antonio Vazquez
0d599ce95a GPencil: Fix unreported NaN value for UV Rotation in Primitives
Using primitive drawings, the point UV rotation was not initialized.
2021-01-20 16:53:42 +01:00
Brecht Van Lommel
1f691050e5 Fix T84539: cryptomatte metadata lost when using save buffers option 2021-01-20 14:59:23 +01:00
Brecht Van Lommel
10d2cbfa36 Fix T84872: OptiX GPU + CPU rendering uses branched path samples
Branched path tracing is not supported for OptiX, and it would still use the
number of AA samples from there when branched path was enabled by the user
earlier but auto disabled and hidden in the UI when using OptiX.

Ref D10159
2021-01-20 14:59:23 +01:00
Brecht Van Lommel
1451f7d093 Fix T84813: enabling Cycles OpenImageDenoise during GPU viewport render fails 2021-01-20 14:59:23 +01:00
Patrick Mours
4a09907eab Fix T84049: Crash when using Cycles Progressive Refine with OptiX+CPU
Tile stealing may steal a CPU tile buffer and move it to the GPU, but next time around that
tile may be re-used on the CPU again (in progressive refinement mode). The buffer would
still be on the GPU then though, so is inaccessible to the CPU. As a result Blender crashed
when the CPU tried to write results to that tile buffer.
This fixes that by ensuring a stolen tile buffer is moved back to the device it is used on before
rendering.
2021-01-20 14:40:27 +01:00
Sergey Sharybin
87db3423c9 Fix Lock to Selection does not work in mask mode
A regression since 2.80: need to use evaluated mask to calculate
its bounds. Non-evaluated mask does not contain state for the
current frame, so iterating over control points of the original
mask gives points state from the time they were edited last (aka,
not affected by the animation).
2021-01-20 13:46:39 +01:00
Campbell Barton
8e5b6320a6 Add Object Tool: minor improvements to tool-tips 2021-01-20 21:47:52 +11:00
Campbell Barton
aee7d8f411 Cleanup: clang-format 2021-01-20 20:42:15 +11:00
Bastien Montagne
c082b21625 Fix typo in UI message.
Noted by Satoshi Yamasaki (@yamyam) in rBTS5522.
2021-01-20 10:15:59 +01:00
Campbell Barton
fad8a753a9 Add Object Tool: adjust cursor alpha when near view aligned
The cursor-plane was too dense/bright when approaching view alignment.
2021-01-20 18:55:44 +11:00
Campbell Barton
908b383b7d UV: tweak face select behavior
When the mouse cursor is inside the UV face,
extend the selection threshold.

This means when zoomed in, a face can always be selected when the cursor
is inside it.
In the case of multiple overlapping faces - the face with the closest
center is used.

----

Prior to 246efd7286f6187e4dd4b3edcc79cccb1746bb1d, the UV selection
threshold was scaled by the zoom level, so selecting a face when zoomed
in close would often often select faces even when the on-screen center
was outside the intended threshold.

Having a zoom-independent threshold may require more precision than
users are used to.

This change addresses this.
2021-01-20 17:07:20 +11:00
Campbell Barton
9f337bef80 Cleanup: move UvNearestHit.ob assignment in find nearest functions
Splitting assignments between functions complicates refactoring.

Also rename 'hit_final' to 'hit', since there are no longer a local
'hit' variable defined in these functions.
2021-01-20 17:00:39 +11:00
Campbell Barton
8bd5d58860 BMesh: add function to check if a point is inside a faces UV's 2021-01-20 16:56:59 +11:00
Campbell Barton
b2037464e4 CMake: add missing headers
Resolves 'cmake_consistency_check' reports.
2021-01-20 16:08:52 +11:00
Campbell Barton
be970c03c2 Cleanup: spelling & cleanup for cmake_consistency_check
Much more could be done here, some obvious corrections.
2021-01-20 16:04:03 +11:00
Campbell Barton
d3fe320b83 CMake: update checking utility to ignore nanovdb files 2021-01-20 16:03:57 +11:00
Campbell Barton
0706a756f9 Cleanup: remove unused file SEQ_util.h
Committed by accident when SEQ_utils.h was also created.
2021-01-20 16:01:40 +11:00
Bastien Montagne
c2e6969c56 Refactor modifier copying code.
Things like pointers to particle systems, or softbody data being stored
outside of its modifier, make it impossible for internal modifier copy
data code to be self-contained currently. It requires extra processing.

In existing code this was handled in several different places, in
several ways, and alltogether fairly inconsistently. Some cases were
even not properly handled, causing e.g. crashes as in T82945.

This commit addresses those issues by:
 * Adding comments about the hackish/unsafe parts `psys` implies when
   copying some modifier data (since we need to ensure particle system
   copying and remapping of those pointers separately).
 * Adding as-best-as-possible handling of those cases to
   `BKE_object_copy_modifier` (note that it remains fragile, but is
   expected to behave 'good enough' in any practical usecase).
 * Remove special handling for specific editor code
   (`copy_or_reuse_particle_system`). This should never have been
   accepted in ED code area, and is now handled by
   `BKE_object_copy_modifier`.
 * Factorize copying of the whole modifier stack into new
   `BKE_object_modifier_stack_copy`, now used by both `object_copy_data`
   and `BKE_object_link_modifiers`.

Note that this implies that `BKE_object_copy_modifier` and
`BKE_object_copy_gpencil_modifier` are now to be used exclusively to
copy single modifiers. Full modifier stack copy should always use
`BKE_object_modifier_stack_copy` instead.

Fix T82945: Crash when dragging modifiers in Outliner.

Maniphest Tasks: T82945

Differential Revision: https://developer.blender.org/D10148
2021-01-19 18:58:35 +01:00
Philipp Oeser
c371d699ca Fix T84784: Time Remapping not displaying in the timeline
Caused by rBbbb2e0614fc3.

Oversight to not take the remapped framelength into account.

Maniphest Tasks: T84784

Differential Revision: https://developer.blender.org/D10134
2021-01-19 18:31:21 +01:00
Philipp Oeser
36f0a1ead7 Fix T84823: crash rendering with unconnected input socket in File Output node
Caused by rB957e292c5864.

Now just skip unconnected sockets.

Maniphest Tasks: T84823

Differential Revision: https://developer.blender.org/D10137
2021-01-19 18:23:53 +01:00
Dalai Felinto
c3207d88c2 Object Info: Fix tooltip for the transform space option
This was agreed outside the patch discussion. And it did not make into
the submitted code on 8b777ee6d69d4805c64756cf6a33db894160ce29.
2021-01-19 18:13:50 +01:00
Jacques Lucke
05179a0ba4 Volumes: fix calling BKE_volume_load from multiple threads
`BKE_volume_is_loaded` uses `grids.filepath` to determine if the
grids are already loaded. The issue was that `grids.filepath` was
set before the grids were loaded, resulting in incorrect early
returns for other threads.

Differential Revision: https://developer.blender.org/D10150
2021-01-19 18:01:22 +01:00
Dalai Felinto
8b777ee6d6 Geometry Nodes - Object Info: option to apply obj transform to the geometry
By design the modified object transformations should still work and
affect the geometry nodes results. The current behaviour, however, would
make the geometry from the object info to not be affected by the
modified object transformations. This patch changes that by default.

In a similar fashion the Location, Rotation and Scale sockets outputs
should be aware of whether the output should be in the global space or in the
space of the nodetree.

To solve this, the patch introduces a new transformation space "enum"
where users can pick "Original" or "Relative" space.

Original
--------
Output the geometry relative to the input object transform, and the
location, rotation and scale relative to the world origin.

Relative
--------
Bring the input object geometry, location, rotation and scale into the
modified object maintaining the relative position between the two objects in
the scene.

Relative space violates a bit the design of the nodetree. The geometry in this
case is transformed so that moving the modified object doesn't interfere with
the geometry. This is particularly useful for the boolean node for instance.

"Original" is the default space, but old files are set to "Relative" for
backwards compatibility.

Differential Revision: https://developer.blender.org/D10124
2021-01-19 17:30:44 +01:00
Falk David
a9203e25a2 Fix T84642: Reassign effect-strip ignores animdata
When reassigning an effect strip to another sequence, any animation data
in the effect strip will not be offset like expected.

The fix calls `SEQ_offset_animdata` to offset the animation data after
the seqence has been moved.

Reviewed By: ISS

Maniphest Tasks: T84642

Differential Revision: https://developer.blender.org/D10096
2021-01-19 12:31:02 +01:00
Campbell Barton
a86bb2594f Fix T84698: error adding movie clip tracks
The movie clip's `region->v2d` was being resized by the view2d code,
causing mouse cursor to movie-clip coordinate mapping to fail.

This commit removes `UI_view2d_region_reinit`,
matching the behavior for the image editor's 2D view.

Reviewed By: sergey

Ref D10106
2021-01-19 20:39:31 +11:00
Campbell Barton
418cd7c4ba Fix T84041: Bevel caps have invalid normals
Bevel caps always had incorrect normals, causing display glitches
in some cases.

It seems this never worked properly (at least 2.79 also had this bug).

Use the projection vector as the normal.
2021-01-19 17:12:01 +11:00
Campbell Barton
e25f7e33ff Fix T84568: UV loop selection marks edges sharp
Regression in 6a10e69d270bc6866dd0000ffc0b81f6205ba2e9
(added when testing).
2021-01-19 15:32:00 +11:00
Falk David
d31dd1da80 Fix T84824: Incorrect height using interactive add tool
When using the interactive add tool for primitives with a fixed
height and base aspect ratio, the height of the created primitive
would be incorrect (two times too small or two times too big).

When the base origin was centered, the `fixed_aspect_dimension`
was not changed even though the base length was doubled.
Additionally, when the height origin was centered but the height
aspect ratio was fixed, the height was doubled leading to an
incorrect size.

The fix doubles `fixed_aspect_dimension` when the base origin is
centered and correctly calculates the height of the primitive when
the aspect ratio is set to fixed.

Ref D10140
2021-01-19 13:20:02 +11:00
Campbell Barton
58e554a55c Fix T66681: Blender 2.7x keymap inconsistencies
Match Blender 2.7x keymap more closely.

- Image Editor: F3 for save image as.
- Node Editor: Ctrl-LMB to cut links.
- Cycle the falloff types instead of showing a pie-menu.
- Use regular menu instead of pie menu for snapping.
2021-01-19 12:20:48 +11:00
Alexander Gavrilov
b5c3f26cba Armature: fix B-Bone deformation blending artifacts with Preserve Volume.
The double quaternion blending method in addition to the deformation
matrix of each bone requires their rest matrices. For ordinary bones
this literally should use the bone rest matrix without any ambiguity.

However, it was also using the bone rest matrix for all of its
B-Bone segments, which is incorrect and causes strange deformation
in some cases involving extreme non-uniform scale, especially
at boundaries between different B-Bones. There is also a similar
known issue that happens with scale at bending joints, and this
fix reduces the distortion when both bones are B-Bones.

This changes both the Armature modifier and the Armature constraint
to use the actual segment rest matrices. Unlike bones, these can have
scale even in rest pose, so normalization is required.

Differential Revision: https://developer.blender.org/D10003
2021-01-18 20:08:16 +03:00
Falk David
5e0ef4ef85 Fix T84719: Doversion for curve edit settings
Make sure default values for curve edit mode are filled for older files.

Reviewed By: antoniov

Maniphest Tasks: T84719

Differential Revision: https://developer.blender.org/D10136
2021-01-18 16:23:13 +01:00
Sergey Sharybin
0d8948387e Cycles: Fix missing OpenCL extensions in certain cases
If extensions string is longer than 1024 then the old code would have
reported empty string instead of extensions.

Now the code does dynamic string allocation to store result of request,
similar to what is done in `OpenCLInfo::get_hardware_id`.

The code looks a bit ugly, but it didn't really change much with this
patch. In other words, the code can become more modern and clear, but
it is considered to be outside of the scope of this change.

Differential Revision: https://developer.blender.org/D10135
2021-01-18 15:47:00 +01:00
Patrick Mours
4fde594fda Fix T84650: CPU render + OptiX denoiser leaves empty tiles unprocessed
The OptiX denoiser is part of the OptiX device, so to the tile manager looks like a GPU device. As a
result the tile stealing implementation erroneously stole CPU tiles and moved them to that OptiX
device, even though in this configuration the OptiX device was only set up for denoising and not
rendering. Launching the render kernel therefore caused a crash because of a missing AS etc.
This fixes that by ensuring tiles can only be stolen by devices that support render tiles.
2021-01-18 15:30:25 +01:00
Philipp Oeser
1c2b203795 Fix T84600: prevent bone groups operators on proxies and library
overrides

Editing bone groups is not supported on proxies/overrides [changes a re
lost on file reload], need to do proper polling (and also prevent this
from rna) for:

- adding bone groups
- removing bone groups
- renaming bone groups
- setting bone groups colors

Previously, this was hinted at by setting the layout inactive, with
preoper polls, this is now not needed anymore.

note: Selection of bone groups actually makes sense here and is
supported, so this is not prevented in this patch, but UI wise this is
not nice in the override case, because one cannot set an active_index
(aka select) in the UI list.

Maniphest Tasks: T84600

Differential Revision: https://developer.blender.org/D10131
2021-01-18 15:00:37 +01:00
Philipp Oeser
b4530deec4 Fix T84586: missing Outliner redraws for certain NLA operators
Outliner display under 'Animation' > 'NLA Tracks' was not updating in
the following cases:
- adding strips
- removing strips
- duplicating strips (possibly to different track)
- swapping strips
- reordering tracks
- changing strip order by translating
- translating strips between tracks
- renaming tracks

In the case of deleting strips/tracks, this was also resulting in a use-
after-free error in Outliner drawing code (this was reported specifically
in T84586).

Most of these operators already sent a ND_NLA|NA_EDITED notifier, but the
Outliner is not listening to these. Listening to NA_EDITED is also not
what we want since this also happens a lot in cases irrelevant to the
Outliner. Now be a bit more specific and send ND_NLA|NA_ADDED / ND_NLA|
NA_REMOVED or a new ND_NLA_ORDER (to distinguish from NA_EDITED
'only' - where a redraw is not neccessary) and listen to these from the
Outliner.

(note: places that were listening to ND_NLA|NA_EDITED before are also
listening to NA_ADDED or NA_REMOVED, so changing NA_EDITED should not be
a problem here)

(note 2: for cases like swapping tracks/strips order, NA_ADDED or
NA_REMOVED does not make sense, neither can we use NA_EDITED [since we
dont want to listen to this], so in this case an additional ND_NLA_ORDER
is now sent)

(note 3: in nla transform code, this is now always sent on confirm. There
are cases were the notifier would not be needed, but checking exactly all
cases were it actually would be needed seems overkill [history of D10073
has example code to check if strips moved between tracks])

Maniphest Tasks: T84586

Differential Revision: https://developer.blender.org/D10073
2021-01-18 13:58:31 +01:00
Philipp Oeser
dfdf79fb03 Fix T84250: Eevee world/material parameter animation not updating the viewport
The WORLD_UPDATE operation (needed to free the gpu material) was already
defined in DepsgraphNodeBuilder::build_world, but corresponding relation
was only set up for changes in the nodetree, not for changes in the
world/material itself in DepsgraphRelationBuilder::build_world.
Direct changes to these surface properties in the UI were updating
properly through RNA property update callbacks, but these are not called
from the animation system.

So now add these relations in the depsgraph.

Not 100% sure this is the right place for this (since e.g. eevee engine
seems to handle e.g. animated light paramters just fine through
EEVEE_cache_populate / eevee_light_setup, but properly freeing gpu
materials wont happen for worlds in e.g eevee_id_world_update and also
not for materials)

Maniphest Tasks: T84250

Differential Revision: https://developer.blender.org/D9959
2021-01-18 13:51:28 +01:00
Bastien Montagne
9f2271d354 Fix T84739: Crash with curve brush in sculpt mode.
No idea why we did not pass context to `ED_paintcurve_undo_push_end`, it
is easily availbale everywhere...
2021-01-18 12:15:46 +01:00
Karthik Rangasai Sivaraman
c85317e669 Fix T83657: Pose Mode: Clearing transform doesn't respect Mirror X
Extend the pose bone "clear loc/rot/scale" functions so that they
respect the "Mirror X" option.

Reviewed By: sybren

Maniphest Tasks: T83657

Differential Revision: https://developer.blender.org/D9938
2021-01-18 11:59:45 +01:00
Campbell Barton
2ee2f87f29 Add Object Tool: move extra settings popover last
This is intended to be used when settings don't fit in the top bar,
so it makes sense to keep them last.
2021-01-17 21:36:49 +11:00
Campbell Barton
06da6e2eaf Add Object Tool: scale the cursor plane based on the depth
Draw the cursor plane smaller then further away from the view.

This makes the plane being drawn onto easier to perceive.
2021-01-17 21:21:18 +11:00
Campbell Barton
5f9358a373 Add Object Tool: split aspect & origin options for base/height
In practice it's common these settings shouldn't be linked for drawing
the initial (base) plane, compared with the height.
2021-01-17 21:16:22 +11:00
Campbell Barton
ca476a638c RNA: report an error when the name property is set twice
This helps avoid copy-paste errors which have happened a few times,
no functional changes.
2021-01-17 18:24:34 +11:00
Campbell Barton
66a87fc9f4 Fix workspace tool name property
The fallback tool was used as the tool name.

Regression in a8ce9a143abbb51eae28e5d0cae1fb310bd0c24c
2021-01-17 18:24:34 +11:00
Wannes Malfait
6fb7d0f559 Fix T84713: Geometry nodes reroute sockets have incorrect type
This implements the node tree update function, which is needed so that the
reroutes get updated to the correct type. It is based on the same code in
the shader and compositor node trees.

Differential Revision: https://developer.blender.org/D10123
2021-01-16 13:09:19 -06:00
Jacques Lucke
1e193a0b56 Fix T84757: feedback loop with when modifying vertex group with nodes
The issue was that the mesh shared its vertex weights with the
original mesh (to reduce memory consumption). The solution is
to make a local copy of the vertex weights in this case.
2021-01-16 15:24:22 +01:00