Commit Graph

116778 Commits

Author SHA1 Message Date
Bastien Montagne
fd57f520ac Py API doc: Add warning that py-defined property accessor callbacks may be called in threaded context.
At least Depsgraph evaluation and liboverride diffing do process IDs in
parallel, so python code in py-defined properties should not access any
data outside of their owner ID.

Ref. T100203.
2022-08-12 16:23:12 +02:00
Bastien Montagne
62eb21e3ce Fix T100203: Freeze using override_hierarchy_create with Object level property with custom getter function.
As suggested by @brecht, use the `BPy_BEGIN`/`END_ALLOW_THREADS` macros.

Note that there may be other bits of code needing this too.
2022-08-12 16:23:12 +02:00
Patrick Mours
515a15f200 Fix syntax error introduced in previous commit 2022-08-12 16:13:09 +02:00
Patrick Mours
79787bf8e1 Cycles: Improve denoiser update performance when rendering with multiple GPUs
This patch causes the render buffers to be copied to the denoiser
device only once before denoising and output/display is then fed
from that single buffer on the denoiser device. That way usually all
but one copy (from all the render devices to the denoiser device)
can be eliminated, provided that the denoiser device is also the
display device (in which case interop is used to update the display).
As such this patch also adds some logic that tries to ensure the
chosen denoiser device is the same as the display device.

Differential Revision: https://developer.blender.org/D15657
2022-08-12 16:00:54 +02:00
Bastien Montagne
27105af938 Cleanup: unused debug variable. 2022-08-12 15:20:43 +02:00
Bastien Montagne
47af1ce8ac Cleanup: leftover debug prints. 2022-08-12 15:18:10 +02:00
Bastien Montagne
c73cc15e07 LibOverride: Rework Outliner contextual menu.
Follow-up to design discussions here at the studio, add liboverride
operations into their own sub-menu, with three main entries:
- Create: Create, or enable for user editing, override hierarchies.
- Reset: Keep overrides data, but reset all local changes to the
  reference linked data values.
- Clear: like reset, but also turn editable overrides back to system
  overrides (aka non user editable).

Those three options can all operate either on the selected items, their
content only, or both.

Advanced operations are moved into a "Troubleshoot Hierarchy" sub-menu,
where one can resync, resync enforced, and fully delete library
overrides. Those operations always affect a whole override hierarchy,
regardless of which items are selected or not.
2022-08-12 15:11:59 +02:00
Campbell Barton
4dc9a8a21e Fix T100191: Crash with the wave modifier using normals in edit-mode 2022-08-12 21:49:06 +10:00
Brecht Van Lommel
4d2e2a6691 Fix T100350: missing brush falloff preview in sculpt mode 2022-08-12 13:46:34 +02:00
Bastien Montagne
e0e4005582 Cleanup: Typos in comments. 2022-08-12 12:42:03 +02:00
Bastien Montagne
afd2e9ebc3 Fix (unreported) infinite tie building Outliner liboverride hierarchy tree.
In complex scenes featuring thousands of connections between IDs in
their liboverride hierarchies (e.g. Heist files), the time required to
check if tree items were available (before allocated a new one) would
become insanely long (O(n^2)).

This commit brings it back to roughly a constant time, only re-checking
the whole array for unused items once in a while (once every 10k times
currently), since in almost all cases is the index after `lastused`
value is not unused, and you have reached the end of the currently used
array of items, you actually need to 'allocate' a new one anyway.

It also improves the handling of `lastused` index, in particular in
`tse_group_add_element`.

This makes switching to the Outliner override hierarchy view in Heist
scenes from virtually infinite time (more than 30mins for sure) to about
20 seconds on my machine. Still far from being effectively usable.

Note that this is only a bandaid fix anyway, root of the issue is that
this view has to deal with way too many items in its tree, current code
is not designed for that. Either outliner has to improve its tree
handling (by only building subsets of the whole tree maybe?), or we have
to cull/filter out some of the ID relationships between overridden IDs
to make this view actually usable. Maybe limit the depth of the tree?
2022-08-12 12:37:10 +02:00
Bastien Montagne
7f44dc79a6 Fix (unreported) crashes in Outliner override hierarchy view.
Fix wrong assumption that 'embedded' IDs are only ever used by their
owners. This is especially not true with shape keys.

Also small optimization by adding an eraly abort when both IDs are the
same (i.e. an ID has a pointer to itself).
2022-08-12 12:37:10 +02:00
Bastien Montagne
12b3616895 IDType get_owner: add an optional hint about owner ID.
In some cases, there is a chance code already knows who might be the
owner of the given ID, in which case it can be more efficient to check
it first (especially in cases like embedded node trees or scene
collections, where the only other way is to loop over all possible
owners currently).

Will be used in next commit in some Outliner fix.
2022-08-12 12:37:10 +02:00
YimingWu
498e26fa0f Fix T100138: Use double for LineArt intersection record.
The use of `float` for intermediate intersection record led to some
inaccuracy which caused flickering in intersection lines. Now fixed.
2022-08-12 15:40:58 +08:00
Campbell Barton
95cc5c6081 Fix T96885: Drag Fallback on Tweak is using Move instead
Since [0] (fix for T95591), the tweak tools fallback action used tweak
instead of press.

This was enabled so tools such as "Measure" & "Add Cube" could use
fallback tools (otherwise is wasn't possible to add a new ruler without
also selecting for e.g.), however this is of limited use since both
tools support dragging anywhere to activate, making them less useful
with other selection tools beside tweak (box/lasso for e.g.).

Resolve by disabling the fallback option for tools where using the
tweak tool to select is undesirable. Selection by clicking with
"Measure" & "Add Cube" is still supported as this is also set in the
3D view's key-map.

[0]: 0e51defcf42e1cb231d36da9ecc2cc0fbe6ae505
2022-08-12 14:24:31 +10:00
Brecht Van Lommel
6161b8dc63 Fix T100130: animation player crash on exit
GPU_exit is now expected to run within an active GPU context.

Also run BLF_exit and IMB_exit first they can use GPU resources and gave
ASAN errors. And remove redundant GPU_shader_free_builtin_shaders already
handled by GPU_exit.
2022-08-11 19:23:15 +02:00
Aras Pranckevicius
0a096f2be2 Fix T98781: OBJ exporter wrongly writing default material socket values when textures are present
Report T98781 and part of T97642: the MTLMaterial info only captures
image nodes and the default socket values. When the image information
is present, do not emit the socket defaults - the .MTL spec states
they are multiplied together, but the default value is not used
in blender when the socket is connected.

Also contains svn tests repository update to extend the test coverage,
and update test expectation outputs.
2022-08-11 15:51:36 +03:00
Campbell Barton
ed55054e57 Fix T100204: RMB select (with "Select Tool") causes edit-mesh conflict
When RMB select activated the selection tool, Alt-RMB would both
tweak and loop-select.

Fix/workaround this by passing though 'enumerate' unless the option
can be used (when selecting objects or armatures).
2022-08-11 11:06:54 +10:00
Aras Pranckevicius
8c59b93505 obj: Also find .mtl images by their basename, if all else fails (T77801)
While T77801 itself is working as expected in the new C++ obj
importer, the repro file there uses absolute paths to material images,
yet the images themselves are right there in the current folder.

The old python based importer did find them, since it was doing a
really complex image search. My understanding is that while C++
importer was developed, it was decided to not do that -- however
just the "basename file in the mtl directory" sounds simple enough
and gets the repro case file work correctly.
2022-08-10 18:03:39 +03:00
Brecht Van Lommel
f9589fab60 Render: remove camera shift hard limits
There is no need for these to be limited to -10..10, soft limits are enough.

Contributed by fundorin.

Differential Revision: https://developer.blender.org/D15650
2022-08-10 13:02:32 +02:00
Aras Pranckevicius
d76583cb4a Fix T100302: New OBJ importer produces too many vertices when faces don't span a continuous range
As part of the previous fix (D15410), the importer got code to track
min & max vertex indices used as part of the mesh faces. However, if
faces refer to a "sparse" (i.e. non-contiguous) subset of all vertices,
then the imported mesh would contain all the vertices between min & max
range.

Replace that with proper tracking of actually used vertex indices
for each imported mesh. Fixes T100302.

This does affect import performance a tiny bit, e.g. importing Blender
3.0 splash scene goes 21.7s -> 22.1s, and importing rungholt.obj
goes 2.37s -> 2.48s.

Importer related tests have a bunch of vertex changes in them, since
now vertices are added in the order that the faces are referring
to them. Which incidentally matches the order that the Python based
importer was creating them too.
2022-08-10 13:34:58 +03:00
Campbell Barton
b114993305 Fix T99963: Fallback actions are used in RCS on left click
Regression in [0].

Disable fallback tools for the 3D cursor so other shortcuts are
available such as lasso-select.

[0]: b0847eff2a29b0f2ba3263afc3f367011703df84
2022-08-10 16:39:29 +10:00
Aaron Carlisle
07ac26f0a5 Update RNA to User manual mappings 2022-08-09 21:26:48 -04:00
Hans Goudey
bdb85bdd98 Fix T100308: Removing scene time node does not update relations
Similar to the fix in 734c6a4405f21078270e71.
2022-08-09 19:09:43 -05:00
Hans Goudey
31e06a8c73 Fix T99661: Use after free converting edit mode curve object to mesh
The fix from c0fdf16561034f85aadae8a was missing in one place. We don't
want to free the edit mode pointers, those are just copied because the
edit mode changes aren't present in the actual original data-block.
2022-08-09 18:24:44 -05:00
Brecht Van Lommel
79f1cc601c Cycles: improve ray tracing precision near triangle edges
Detect cases where a ray-intersection would miss the current triangle, which if
the intersection is strictly watertight, implies that a neighboring triangle would
incorrectly be hit instead.

When that is detected, apply a ray-offset. The idea being that we only want to
introduce potential error from ray offsets if we really need to.

This work for BVH2 and Embree, as we are able to match the ray-interesction
bit-for-bit, though doing so for Embree requires ugly hacks. Tiny differences
like fused-multiply-add or dot product intrinstics in matrix inversion and ray
intersection needed to be matched exactly, so this is fragile.

Unfortunately we're not able to do the same for OptiX or MetalRT, since those
implementations are unknown (and possibly impossible to match as hardware
instructions). Still artifacts are much reduced, though not eliminated.

Ref T97259

Differential Revision: https://developer.blender.org/D15559
2022-08-09 18:42:01 +02:00
Brecht Van Lommel
230f9ade64 Cycles: make transform inverse match Embree exactly
Helps improve ray-tracing precision. This is a bit complicated as it requires
different implementation depending on the CPU architecture.
2022-08-09 16:59:05 +02:00
Brecht Van Lommel
286e535071 Cleanup: simplify CPU instruction checking
The performance of this will be slightly more important for upcoming changes.
Also removed an unused function and changed includes so these system.h can
be included in more places.
2022-08-09 16:59:05 +02:00
Sergey Sharybin
9644740230 Fix T99949: Crash when last input from File Output node is deleted
Regression since e4278b72bb1a.

Need to check inputs exist prior to requesting first input as it
might not exist.
2022-08-09 16:44:36 +02:00
Sergey Sharybin
cefd6140f3 Fix T100119: Cycles light object's parametric vector distorted
Caused by 38af5b050100.

Adjust barycentric coordinates used for intersection result in the
ray-to-rectangle intersection check.

Differential Revision: https://developer.blender.org/D15592
2022-08-09 15:56:03 +02:00
Campbell Barton
7b0bc1573b Fix memory leak exporting to collada 2022-08-09 21:04:25 +10:00
Damien Picard
e1974ae30e I18n: make more parts of the UI translatable
- "Name collisions" label in mesh properties
- "Threshold" labels in Vertex Weight Edit modifier
- "Particle System" label in Particle Instance modifier
- Slot number in the Shader Editor

- Status bar keymap items during modal operations:
  add TIP_() macro to status bar interface template

- On dumping messages, sort preset files so their messages are stable
  between runs

Ref. T43295

Reviewed By: mont29

Differential Revision: https://developer.blender.org/D15607
2022-08-09 12:42:33 +02:00
Bastien Montagne
630b961f23 I18n: add extraction of modal event names.
Alternative fix to the one proposed in D15607.

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D15643
2022-08-09 12:22:30 +02:00
Bastien Montagne
2682a59efe WM Modal Keymaps: Add accessors to modal event values.
It is currently impossible to access modal keymaps' event values (from
`propvalue` enum) from python code (for API introspection).

This is needed for i18n messages extraction (see D15607).

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D15643
2022-08-09 12:22:13 +02:00
Damien Picard
219b4dbc3c I18n: remove Window class from message extraction blacklist
Messages from the bpy.types.Window class were blacklisted in the
message extraction script.

This change allows a few new messages to be translated, including at
least two which show up in the UI. There are only 12 new messages in
the .po files, so even if some never need to be translated, that's not
too many.

Ref. T43295

Reviewed By: mont29

Differential Revision: https://developer.blender.org/D15628
2022-08-09 11:41:29 +02:00
Campbell Barton
90b2ed6c4b Fix T100277: Grease pencil lines don't start at click-start
Regression in b8960267dd51f9108b3b49e9b762e6b4d35ae1dc.
2022-08-09 13:52:27 +10:00
Campbell Barton
228f7cb5ce Fix viewport operators with a view locked camera
Smooth-view wasn't working properly with a locked-camera this could
animate from the wrong position if the camera wasn't in sync with the
underlying viewport transformation.

Resolve issues for:

- VIEW3D_OT_view_orbit
- VIEW3D_OT_view_roll
- VIEW3D_OT_zoom_border
2022-08-09 09:31:20 +10:00
Campbell Barton
8ed2abf856 Fix missing undo steps for smooth-view operators
Support pushing undo steps for smooth-view operations that manipulate
the camera. Now V3D_SmoothParams take optional undo arguments.

Used for:

- VIEW3D_OT_view_center_cursor
- VIEW3D_OT_view_center_pick
- VIEW3D_OT_view_orbit
- VIEW3D_OT_view_roll
- VIEW3D_OT_zoom_border

Follow up fix for T92099.
2022-08-09 09:31:18 +10:00
Germano Cavalcante
b3fc8206be Revert "Fix T100280: GG not toggling the offset transform mode in tracker"
This reverts commits b72eddac6190353714745756dcc335f98cda1369 and
f8b5706a1ffe61ae3bdd949ad851d6e9ff3fe188.

And fixes T100265.

It brings more problems than solutions.
2022-08-08 12:37:25 -03:00
Brecht Van Lommel
2e6fcd9aad Fix Cycles crash after recent bugfix for image saving 2022-08-08 16:59:37 +02:00
Germano Cavalcante
b72eddac61 Fix T100280: GG not toggling the offset transform mode in tracker
Caused by {rB791bfae1d64b}.

The solution was to create the special handle for the Move Clip and Mask
transformation.

One change that cannot be reversed is showing the `G` shortcut in the
statusbar.

But the description of this shortcut was not even correct before.
2022-08-08 10:59:29 -03:00
Brecht Van Lommel
4b3315fc98 Fix T100281: image save after copy not using correct filepath
Always use the image datablock filepath for saving. The only apparent reason
use the image buffer file path is image sequences, for which the current frame
filepath is now computed.
2022-08-08 13:51:19 +02:00
Nikita Sirgienko
1382514bf2 Fix: Error in oneAPI image code for texture access with clip extension 2022-08-08 10:47:11 +02:00
Xavier Hallade
e4938b163e Cycles: re-enable zebin format for Intel GPUs on Linux
zebin format is critical for the compatibility of AoT graphics binaries
across driver versions. It was previously disabled on Linux due to
runtime issues that are now fixed in
https://github.com/intel/compute-runtime/releases/tag/22.31.23852.
The minimum supported driver version isn't bumped to this one yet as
current codebase with current IGC compiler does actually run fine on
earlier drivers and is not running into these issues anymore.
2022-08-07 22:54:15 +02:00
Hans Goudey
344c53561a Fix: Incorrect field node deduplication for shortest path nodes
Mistake in c8ae1fce6024556b72c.
2022-08-07 14:38:17 -05:00
Hans Goudey
800c7dbf41 Fix: Missing translation in deform curves on surface node
Also add an error message for when the node is used on non-curves
objects, since there's nothing in the UI to show why it doesn't work
except for that. And also use quotes when referring to attribute names.
2022-08-06 17:01:01 -05:00
Howard Trickey
d58476049e Fix T98025: Revert "Fix Bevel intersection continuity."
This reverts commit 94866ef84f1907116409f8fe9c1f313405
A number of reports of bevel regressions came after the
commit to fix bevel intersection continuity.
Since the fix for some of those regressions is not obvious
we will revert the continuity improvement and do it as
part of the Bevel V2 project.
2022-08-06 12:40:11 -04:00
YimingWu
8dadc091d0 LineArt: Usability improvement for "Enclosed Shapes".
This patch removes the [rather confusing] separate checkbox for enclosed
shapes in favour of integrating that option into illumination filtering,
with the benefit of not limiting the selection to cached result.

Reviewed By: Sebastian Parborg (zeddb)

Differential Revision: https://developer.blender.org/D15327
2022-08-06 12:20:15 +08:00
Pratik Borhade
befe38fe1d Fix T92099: No undo when moving viewport with camera locked to view
Supports undo step generation while navigating in locked camera view.
NDOF & track-pad navigation are not included for now.

Actions that uses smooth view can be supported but are outside
the scope of this change, includes undo push for:

- VIEW3D_OT_view_pan
- VIEW3D_OT_dolly
- VIEW3D_OT_fly
- VIEW3D_OT_move
- VIEW3D_OT_rotate
- VIEW3D_OT_walk
- VIEW3D_OT_zoom

Reviewed by: campbellbarton

Ref D15345
2022-08-06 12:57:06 +10:00
Hans Goudey
74f983738a Fix T100143: RNA path information of Curves datablock incorrect 2022-08-05 12:53:27 -05:00