115436 Commits

Author SHA1 Message Date
Campbell Barton
3ca76ae0e8 Cleanup: remove "<pep8 compliant>" from headers
It can be assumed that all scripts comply with basic pep8 formatting
regarding white-space, indentation etc.

Also remove note in best practices page & update `tests/python/pep8.py`.

If we want to exclude some scripts from make format,
this can be done by adding them to `ignore_files` in:
source/tools/utils_maintenance/autopep8_format_paths.py

Or using `# nopep8` for to ignore for individual lines.

Ref T98554
2022-06-02 20:16:20 +10:00
Campbell Barton
48bb144fea PyDoc: reference enum instead of inlining 2022-06-02 20:16:20 +10:00
Sybren A. Stüvel
f4456a4d3c Expose background job info to Python
Add `bpy.app.is_job_running(job_type)` as high-level indicator. Job
types currently exposed are `WM_JOB_TYPE_RENDER`,
`WM_JOB_TYPE_RENDER_PREVIEW`, and `WM_JOB_TYPE_OBJECT_BAKE`, as strings
with the `WM_JOB_TYPE_` prefix removed. The functions can be polled by
Python code to determine whether such background work is still ongoing
or not.

Furthermore, new app handles are added for
`object_bake_{pre,complete,canceled}`, which are called respectively
before an object baking job starts, completes sucessfully, and stops due
to a cancellation.

Motivation: There are various cases where Python can trigger the
execution of a background job, without getting notification that that
background job is done. As a result, it's hard to do things like
cleanups, or auto-quitting Blender after the work is done.

The approach in this commit can easily be extended with other job types,
when the need arises. The rendering of asset previews is one that's
likely to be added sooner than later, as there have already been
requests about this.

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D14587
2022-06-02 11:20:17 +02:00
Clément Foucault
40ecf9d606 Merge branch 'blender-v3.2-release' 2022-06-02 10:05:56 +02:00
Clément Foucault
33eeed5b3c Fix T98538 EEVEE: Geometry input node breaks with Displacement Texture
This was due to older drivers not honoring varying attributes shadowing by
local variables. Renaming the input argument fixes the issue.
2022-06-02 10:05:14 +02:00
Campbell Barton
d73adfdc86 PyDoc: changes to the generated conf.py file
- Set the highlight language to python3 (excludes python2 syntax).
- Set the encoding for code highlighting to utf-8 (no need to detect).
- Update deprecated variable name.
- Remove redundant unicode prefixed string.
2022-06-02 15:02:25 +10:00
Campbell Barton
0f73a27b76 Fix T98552: Experimental Tweak Select: Curve handle tweak is difficult
When this preference is enabled, use selection behavior matching the
graph editor. We may want to make this default (see T98552).
2022-06-02 13:55:06 +10:00
Campbell Barton
ef3f33dfd3 Cleanup: quiet warnings, remove unused arguments 2022-06-02 13:47:54 +10:00
Richard Antalik
7afcfe111a VSE: Make time operations self-contained
This patch makes it possible to manipulate strips without need to use
update functions to recalculate effect and meta strips.

Prior to this change function `SEQ_time_update_sequence` had to be used
to update mainly effects and meta strips. This was implemented in a way
that relied on sorted list of strips, which can't always be done and in
rare cases this approach failed.

In case of meta strips, `seqbase` had to be passed and compared with
"active" one to determine whether meta strip should be updated or not.
This is especially weak system that is prone to bugs when functions are
used by python API functions.

Finally, other strip types had startdisp` and `enddisp` fields updated
by this function and a lot of code relied on these fields even if strip
start, length and offsets are available. This is completely
unnecessary.

Implemented changes:
All effects and meta strips are updated when strip handles are moved or
strip is translated, without need to call any update function.

Function `SEQ_time_update_sequence` has been split to
`SEQ_time_update_meta_strip_range` and
`seq_time_update_effects_strip_range`. These functions should be only
used within sequencer module code. Meta update is used for versioning,
which is only reason for it not being declared internally.

Sequence fields `startdisp` and `enddisp` are now only used for
effects to store strip start and end points. These fields should be
used only internally within sequencer module code.
Use function `SEQ_time_*_handle_frame_get` to get strip start and end
points.

To update effects and meta strips with reasonable performance, cache
for "parent" meta strip and attached effects is added to
`SequenceLookup` cache, so it shares invalidation mechanisms.
All caches are populated during single iteration.

There should be no functional changes.

Differential Revision: https://developer.blender.org/D14990
2022-06-02 03:16:20 +02:00
Campbell Barton
604409b8c7 Cleanup: undeclared warning 2022-06-02 10:07:07 +10:00
Campbell Barton
f60ac5068a PyDoc: remove CSS override for scrolling long enum lists
Adding a scroll-bar to in-line lists has the down-side that it cuts
of text including warnings or notes that can be included, see: T87008.

Now enums are referenced [0] this is no longer needed, reverting [1].

[0]: 1c6b66c9cf80b3c9b4542b27948ae232f930a211
[1]: 1e8f2665916c049748a3985a2fce736701925095
2022-06-02 10:03:00 +10:00
Chris Blackbourn
fb08353f38 Cleanup: replace ParamBool and PBool with bool for GEO_uv API
Also improve const correctness and type correctness.

Reviewed By: brecht

Ref D15075
2022-06-02 09:52:51 +10:00
Chris Blackbourn
b450a8c851 Cleanup: remove unused area smoothing logic for UV unwrap
This used to run when holding Shift while unwrapping until 2006 when it
was removed [0].

[0]: e66b5e5cd5758f1259ec5a22d47f58ec3e9e3536

Reviewed By: brecht

Ref D15075
2022-06-02 09:47:01 +10:00
Cian Jinks
68150b666c Fix T92952: Knife inconsistent angle printout
Knife could display incorrect snapping angle printout in
header/footer because it was not always updated after angle snapping
calculations.
2022-06-01 21:20:53 +01:00
Antonio Vazquez
129ea355c8 GPencil: Add support to name new layer when moving to layer
To make it consistent with collections, now it's possible to name the new layer created using the `Move to Layer` option.

Differential Revision: https://developer.blender.org/D15092
2022-06-01 18:25:12 +02:00
Thomas Dinges
bff9841465 Merge branch 'blender-v3.2-release' 2022-06-01 15:44:19 +02:00
Thomas Dinges
a493956eaa Release schedule: Entering Bcon4 for Blender 3.2 (RC) 2022-06-01 15:39:52 +02:00
Bastien Montagne
a1e6245650 Merge branch 'blender-v3.2-release' 2022-06-01 15:04:54 +02:00
Bastien Montagne
e72b86d3cb Fix T98469: Crash trying to add an object to a linked collection that is linked to multiple scenes.
Crash happened because code could not find a valid base in current scene
after adding the object, added some checks for that.

Root of the issue was wrong assumptions in `BKE_object_add` logic, which
would pick the first valid ancestor collection in case initially
selected collection was not editable. In some case, this could pick a
collection not instanced in the current scene's view layer, leading to
not getting a valid base for the newly added object.

Addressed this by adding a new variant of `BKE_collection_object_add`,
`BKE_collection_viewlayer_object_add`, which ensures final collection is
in given viewlayer.
2022-06-01 15:04:34 +02:00
Philipp Oeser
c667069a12 Merge branch 'blender-v3.2-release' 2022-06-01 14:55:26 +02:00
Philipp Oeser
7dd0258d4a Fix T98536: geometry nodes wrong selection on duplicate edges
Code was using the loop [which is looping over the selection] index as
an index for the lookup into the edges directly, but needs to be a
lookupinto the IndexMask.

Also renamed the variable (as used elsewhere) to make this more clear.

If accepted, would be nice to still get this into 3.2.

Maniphest Tasks: T98536

Differential Revision: https://developer.blender.org/D15089
2022-06-01 14:53:35 +02:00
Campbell Barton
ae0b68e129 Merge branch 'blender-v3.2-release' 2022-06-01 22:46:17 +10:00
Campbell Barton
e0f3c23ac0 Fix T98370: Shift+RMB Select nodes doesn't work with the tweak tool
The tweak tool was toggling node selection twice, as the selection
key-map is already accounted for in the node key-map there is no need
to duplicate the actions in the tweak tool.
2022-06-01 22:45:45 +10:00
Hans Goudey
e9eae1b857 Curves: Avoid optimization to avoid storing selection for now
This optimization should be restored when there is proper vizualization
for the selection attributes.
2022-06-01 11:57:38 +02:00
Yiming Wu
110c90b3cf LineArt: Adding a intersection timer.
This is for conveinence of perfomance comparison.
2022-06-01 16:59:46 +08:00
Philipp Oeser
d3b3d72303 Fix T98520: Sculpt operators can unintentionally clear multires mask
Typo in {rBcf69652618fe}.

Maniphest Tasks: T98520

Differential Revision: https://developer.blender.org/D15087
2022-06-01 10:48:56 +02:00
Brecht Van Lommel
e5ab1495e5 Merge branch 'blender-v3.2-release' 2022-06-01 10:30:30 +02:00
Brecht Van Lommel
da7bc51210 Fix failing Cycles Metal MNEE test on buildbot, by disabling it
It appears that Metal and MNEE are still not working.
2022-06-01 10:28:09 +02:00
Bastien Montagne
38acd14fb7 Tweak Object duplicate_move macro tooltips.
Since we have two macros, we can at least have proper different tooltips
for each.
2022-06-01 09:29:42 +02:00
Yiming Wu
71ce47a71d LineArt: Temporary fix for object loading iterator.
Use `DEG_OBJECT_ITER_BEGIN`for loading objects, this iterator is
technially unsafe to use *during* depsgraph evaluation,
see https://developer.blender.org/D14997 for detailed explainations.
2022-06-01 14:35:33 +08:00
Campbell Barton
1bf35f1b19 Cleanup: minor changes to sphinx_doc_gen
- Remove unused pymethod2sphinx.
- Correct exception string formatting.
- Define encoding for file reading with execfile(..).
2022-06-01 15:48:20 +10:00
Campbell Barton
61a7e5be18 Cleanup: '*' prefix C-comment blocks 2022-06-01 15:38:48 +10:00
Campbell Barton
4cab98f8be Cleanup: spelling in comments, use doxy sections 2022-06-01 15:38:48 +10:00
Campbell Barton
0f29f2c3e6 Cleanup: remove redundant const qualifiers for scalar & enum types 2022-06-01 15:38:48 +10:00
Campbell Barton
44bac4c8cc Cleanup: use 'e' prefix for enum types
- CustomDataType -> eCustomDataType
- CustomDataMask -> eCustomDataMask
- AttributeDomain -> eAttrDomain
- NamedAttributeUsage -> eNamedAttrUsage
2022-06-01 15:38:48 +10:00
Kévin Dietrich
ca346d2176 Merge remote-tracking branch 'origin/blender-v3.2-release' 2022-06-01 07:02:32 +02:00
Kévin Dietrich
54d076b20d Fix T98526: broken corner attributes with GPU subdivision
Although reusing the same patch coordinate for all corner pointing the
same vertex works for interpolation vertices, it does work for
interpolation face varying attributes. So we need to keep the original
patch coordinates around for face varying interpolation. This was caused
by the previous fix (a5dcae0c641604c033f852e41841f58460c40069).
2022-06-01 07:02:05 +02:00
Campbell Barton
46cb24e7c2 Merge branch 'blender-v3.2-release' 2022-06-01 14:31:55 +10:00
Campbell Barton
0e8d6c2828 Cleanup: conversion from enum/int warning 2022-06-01 14:30:57 +10:00
Chris Blackbourn
65e7d49939 Fix T89726: Fix hitbox of axis gizmo in UV Editor
Use the scale from the wmGizmo.matrix_final as a reference for the
arrow head-size.

Reviewed By: campbellbarton

Ref D15056
2022-06-01 14:23:37 +10:00
Jesse Yurkovich
ee57afe7e1 Merge remote-tracking branch 'origin/blender-v3.2-release' 2022-05-31 21:09:35 -07:00
Jesse Yurkovich
12642bdeab Fix T96984: Create new image.browse operator for uiTemplateImage layouts
The existing BUTTONS_OT_file_browse operator that's used for
uiTemplateImage layouts fails to work correctly with UDIM textures.

This is mainly due to it not realizing that it must tokenize the
filepath before signaling that an update has been made. It also doesn't
work correctly when executing its SHIFT-click behavior to open the image
in an external application. Lastly, it doesn't set the filters to Images
and Movies which is suboptimal for the user.

The new operator takes the unique features of BUTTONS_OT_file_browse
and creates a customized variant better suited for images.

Differential Revision: https://developer.blender.org/D14824
2022-05-31 20:57:33 -07:00
Joseph Eagar
b38a59881b Merge branch 'blender-v3.2-release' 2022-05-31 16:35:22 -07:00
Joseph Eagar
6cee404914 GPU subdiv: Fix edit mode vertex color not being uploaded properly
Also cleaned up the code a tad bit.  Note that I
found two more bugs:

* GPU subdivision attribute interpolation
  is producing visual artifacts.
* "Show on cage" mode for subdivision surface
  just shows black colors.
2022-05-31 16:32:42 -07:00
Joseph Eagar
75162ab8c2 Fix T97408: Temporary fix for attribute convert undo
Sculpt undo now detects if an attribute layer has
changed type/domain and unconverts it back.  This
is a temporary workaround to a more fundamental
bug in the undo system.

Memfile undo assumes it can always rebuild the
application state from the prior undo step,
which isn't true with incremental undo systems.

The correct fix is to push an extra undo step prior
to running an operator if an incremental undo system
is active and the operator is using memfile undo.
2022-05-31 15:46:09 -07:00
Joseph Eagar
79cee340a8 Merge branch 'blender-v3.2-release' 2022-05-31 12:45:24 -07:00
Joseph Eagar
511a08585d Fix T98364: Remove improper OPTYPE_UNDO flags
Removed OPTYPE_UNDO flags from the swap brush colors and
sample color operators.  These types of operators are
not supposed to be undoable in the first place.  Also
memfile undo is too buggy for it.
2022-05-31 12:43:07 -07:00
Jacques Lucke
b9f29a0f64 Merge branch 'blender-v3.2-release' 2022-05-31 20:44:56 +02:00
Jacques Lucke
0f47506cde Fix T98501: setting node socket default value is very slow
The issue was that the extend socket (the last empty socket in
Input/Output nodes) was repeatedly removed and added again,
which caused more updates than necessary. Now, the extend
socket is kept if it existed already.

Differential Revision: https://developer.blender.org/D15084
2022-05-31 20:43:53 +02:00
Jacques Lucke
5c80bcf8c2 Functions: speedup preparing multi-function parameters
My benchmark which spend most time preparing function parameters
takes `250 ms` now, from `510 ms` before. This is mainly achieved by
doing less unnecessary work and by giving the compiler more inlined
code to optimize.

* Reserve correct vector sizes and use unchecked `append` function.
* Construct `GVArray` parameters directly in the vector, instead of
  moving/copying them in the vector afterwards.
* Inline some constructors, because that allows the compiler understand
  what is happening, resulting in less code.

This probably has negilible impact on the user experience currently,
because there are other bottlenecks.

Differential Revision: https://developer.blender.org/D15009
2022-05-31 20:41:01 +02:00