Commit Graph

135811 Commits

Author SHA1 Message Date
Campbell Barton
343b18d8ce Tools: make weekly report executable 2024-05-06 11:06:13 +10:00
Campbell Barton
ab6e00bd7d Cleanup: sort cmake file lists 2024-05-06 09:20:57 +10:00
Campbell Barton
948dc29dd8 Cleanup: order return arguments last 2024-05-06 09:20:06 +10:00
Campbell Barton
c5ad937f53 Cleanup: match argument names in function & declaration 2024-05-06 09:20:05 +10:00
Campbell Barton
bb172dae61 Cleanup: use const variables & arguments 2024-05-06 09:20:03 +10:00
Campbell Barton
1c50e12d86 cppcheck: support canceling without overwriting the previous log
Without this canceling cppcheck part way through meant comparing old/new
log-files wasn't possible without manual renaming.

Now the new log-files are only written (and previous execution renamed
to ".old.log") once generating the log has completed.
2024-05-06 09:20:02 +10:00
Harley Acheson
8735a8a6be UI: Different Warning for Revert if Unsaved Images
Change to the confirmation when reverting the current blend file to
include a specific warning if there are unsaved images.

Pull Request: https://projects.blender.org/blender/blender/pulls/121288
2024-05-05 19:31:20 +02:00
Jacques Lucke
18600e430c Geometry Nodes: show correct type in menu socket tooltips
Previously, menu sockets were sometimes shown as integers or strings
in socket tooltips. Now, they are always shown as "Menu" type. This also
changes how these values are logged. Previously, they were logged as
strings. Now, only the integer identifier is logged and the name is looked
up when drawing the tooltip.

Pull Request: https://projects.blender.org/blender/blender/pulls/121236
2024-05-05 09:30:02 +02:00
Jacques Lucke
a7cae51cf7 Cleanup: quite gcc array-bounds warning
This warning is known to produce false-positives unfortunately.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56456
2024-05-05 08:53:25 +02:00
YimingWu
3be6dbb02a Fix #121366: Invalid mat_nr after exact boolean
Material index of faces could be a invalid value after booleaning in
exact boolean in "Index Based" mode against objects with no material
slots, this is caused by the lack of initilization material remapping
array. Now all initilized to 0.

Assigning 0 explicitly in Fast mode as well for consistency.

Pull Request: https://projects.blender.org/blender/blender/pulls/121380
2024-05-04 13:29:35 +02:00
Pratik Borhade
7ec4218d1d Fix #121296: Surface Deform node-group not marked as modifier
Set `GEO_NODE_ASSET_MODIFIER` to include the surface deform modifier in
modifier list.

Pull Request: https://projects.blender.org/blender/blender/pulls/121306
2024-05-04 12:52:41 +02:00
Campbell Barton
c34a1b5c47 Cleanup: use return instead of an argument for PyC_MainModule_Backup 2024-05-04 16:42:08 +10:00
Campbell Barton
cdf15010c0 Cleanup: de-duplicate logic to evaluate Python expressions 2024-05-04 16:34:59 +10:00
Campbell Barton
2104e6b07d Cleanup: require filepath to be non-null for Python name-space creation
All callers pass in a non-null filepath, require this as it's
often expected to be set and useful in error messages.
2024-05-04 15:48:01 +10:00
Campbell Barton
d3c6eeb03e Docs: merge doc-strings, move move into header 2024-05-04 15:36:28 +10:00
Campbell Barton
98f319ce02 Cleanup: spelling in comments 2024-05-04 15:24:46 +10:00
Campbell Barton
4f5f0040c0 Cleanup: back-tick quote file extensions in code-comments 2024-05-04 15:06:46 +10:00
Campbell Barton
761dd6c923 IO: enable mesh validation by default for STL, PLY & OBJ importers
When moving importers from Python to C++ validation was removed
(from PLY) & disabled by default (STL & OBJ) which re-introduces
crashes reported by users such as #31835.

Enable validation by default because crashes caused by imported data
should be avoided, especially since the crashes may happen later when
users enter edit-mode or run certain editing operations.

This does slow down importing, from testing a 236MB .OBJ it takes around
twice as long to import (~1.5 to ~3 seconds). Although validation can
be optimized to reduce the overhead ad well as run in parallel for
importers that load multiple objects.

The defaults for USD and Alembic remain unchanged since this was never
enabled by default, although we could consider enabling these as well.
2024-05-04 14:40:06 +10:00
Julian Eisel
ff4fc03023 UI: Make asset shelf type registration space-type independent
Rather than storing asset shelf types only for the space type defined
with `bl_space_type`, store them statically/globally so that asset shelf
popups can later be displayed in any space. In earlier designs the asset
shelf was more space dependent than it is now.

For example the brush selector asset shelf popup being implemented for
the brush assets project should be available in the tool settings UI,
which is also displayed in the Properties. If the asset shelf type is
space dependent, this popup won't work in the Properties.

To be clear, `bl_space_type` will still be what defines where the asset
shelf region will be available. But the popup version can be displayed
anywhere.

Pull Request: https://projects.blender.org/blender/blender/pulls/121411
2024-05-03 23:16:29 +02:00
Julian Eisel
a700c90ec3 Asset Shelf: Add callback to get active asset
Add a function for asset shelves, `get_active_asset` in RNA, that
can be used to sync the active item of an asset shelf with an asset
reference elsewhere in Blender. In the brush asset system this is
used to retrieve the asset reference from the active `Paint` struct.

Pull Request: https://projects.blender.org/blender/blender/pulls/121405
2024-05-03 15:27:35 -04:00
Hans Goudey
eccc24e4a6 Fix #121251: Node tools menu hidden on file load with local tools
Sometimes the asset library is not available when we still need
to draw menu because there are local data-block tools.
2024-05-03 15:12:55 -04:00
Hans Goudey
798219225d Asset Shelf: Add optional operator to activate assets
The operator stored when registering the asset shelf will be called
with properties that reference the asset (a weak reference, split into
three properties already used in other asset-related operators). The
operator is called whenever a grid view item is activated, and is
meant to do things like import and activate a brush asset.

Previously Reviewed: https://projects.blender.org/blender/blender/pulls/117861

Pull Request: https://projects.blender.org/blender/blender/pulls/121402
2024-05-03 19:24:00 +02:00
casey bianco-davis
3f15c244f4 GPv3: Draw tool: "Draw on back" option
This adds the `Draw on back` option to GPv3.

Note:
In the legacy system the stroke being drawn would be displayed
in front and only moved to the back upon finishing the operator.
Whereas this will display the stroke on back throughout the
drawing operation.

Pull Request: https://projects.blender.org/blender/blender/pulls/120894
2024-05-03 18:04:38 +02:00
Hans Goudey
18eecb16db Cleanup: Remove unhelpful unreachable asset in asset shelf code 2024-05-03 11:41:37 -04:00
Julian Eisel
a6ebfb05ad UI: Option to store enabled asset shelf catalogs in preferences
Adds a new asset shelf option (`STORE_ENABLED_CATALOGS_IN_PREFERENCES`
option in RNA) to use the Preferences for storing the enabled catalogs.
This way asset shelf types can decide if for their use-case, they want
to synchronize the enabled catalogs over Blender sessions and files, or
keep the stored locally in the file.

This is important because for example on one hand, it would be annoying
if for brush assets you'd have to enable the visible catalog tabs for
every 3D View and every file, while on the other hand you need that
level of control for the pose library where the catalogs the rigger/
animator cares about varies from project to project, character to
character and shot to shot.

Conceptually this also makes some sense: The new brush assets workflow
synchronizes brush assets and their catalogs across Blender sessions
and files, basically making them globally accessible independent of
the current file/project, so treating the enabled catalogs the same
is consistent.

Previously reviewed in #120264

Pull Request: https://projects.blender.org/blender/blender/pulls/121363
2024-05-03 10:20:01 -04:00
Campbell Barton
95fcffed4a Cleanup: remove debug print 2024-05-03 23:23:35 +10:00
424032b5e5 Grease Pencil: Fix Python error when built without experimental features
When Blender is built using `WITH_EXPERIMENTAL_FEATURES=OFF`, the GP
custom properties panel still tries to access `bpy.types.GreasePencilv3`,
which then doesn't exist.

This is a very simple, local fix that checks whether that type exists,
and only then defines `DATA_PT_grease_pencil_custom_props`.

Pull Request: https://projects.blender.org/blender/blender/pulls/121394
2024-05-03 15:23:03 +02:00
Iliya Katueshenock
4732e7cda5 Cleanup: incorrect assertion
This assertion was added in assumption that sizes of input argument are always correct.
But this is not such. More correct is to depend on assertions of span access methods.

The size of the multi-function parameters is only guaranteed to be large enough so that
every index in the mask can be accessed. It may be larger.

Pull Request: https://projects.blender.org/blender/blender/pulls/121393
2024-05-03 15:05:48 +02:00
Hans Goudey
8203184192 Cleanup: Modernize variable naming in mesh_validate.cc
Change "poly" to "face" and "loop" to "corner"
2024-05-03 08:50:07 -04:00
Bastien Montagne
24560b6016 Fix #121310: Marking or clearing 'Fake User' on ID not undoable.
Remapping of internal ID pointers in 'undo swap' case (i.e. when new ID
data had to be read from undo buffer, but current ID address is kept)
needs to also ignore 'fake user' handling, otherwise it would reverse
the undoing effect.
2024-05-03 12:54:11 +02:00
Arye Ramaty
1db538683d Geometry Nodes: add selection and depth options to Realize Instances node
Previously, the Realize Instances node would always realize everything in the geometry.
Now it's possible to more selectively realize parts of the geometry:
* One can choose which top level instances should be realized.
* The realization depth can be controlled per top-level instance. For example, if there are
  5 top level instances, each of which contains 10 other instances, it's now possible to
  realize only one level so that one ends up with 50 instances.

Pull Request: https://projects.blender.org/blender/blender/pulls/116582
2024-05-03 12:47:59 +02:00
Clément Foucault
b00c6d7d13 GPU: Fix shader builder stubs 2024-05-03 12:24:33 +02:00
Aras Pranckevicius
3b67075f40 BLI: Make color sRGB<->Linear non-SIMD fallback path use the same approximation
All official Blender platforms use the SIMD code path, with pow() approximations
for 2.4 and 1/2.4 powers. The non-SIMD code path would only be used on other
platforms like PowerPC etc. Make that fallback scalar code path use the same
math approximation for consistency. This is part of #121312.

This also makes srgb_to_linearrgb_v3_v3 and linearrgb_to_srgb_v3_v3 functions
non-inlined. They are 50-100 CPU instructions, and thus hardly good candidates
for forced inlining into each and every call site.

Also _bli_math_blend_sse now uses actual SSE4 blend instruction instead of doing
it in a roundabout way.

Pull Request: https://projects.blender.org/blender/blender/pulls/121368
2024-05-03 12:05:56 +02:00
Iliya Katueshenock
29aecbf74c Fix #120841: parent nodes don't get logs from zones
Issue was in the fact that log should be propagated on source node and on parent node.
Instead of `group_node_id`, loggers need to have id of actual parent (zone node or node group) node.
This also fix issue with timings propagation on frame nodes.

Pull Request: https://projects.blender.org/blender/blender/pulls/120842
2024-05-03 11:59:35 +02:00
Sergey Sharybin
89ace28b30 Fix #121342: Alt + H unhides bones with drivers
Pull Request: https://projects.blender.org/blender/blender/pulls/121384
2024-05-03 11:52:41 +02:00
Campbell Barton
cd5dd6e454 Fix #115648: Crash on startup with an incompatible PYTHONPATH
Regression in [0]. PyPreConfig.use_environment was internalized to 0
but PyConfig.use_environment wasn't.

Thanks to @unwave for finding the root cause.

[0]: cafd6b519c5f5c4b67d0dfe3d453cd4223b38716
2024-05-03 15:48:35 +10:00
YimingWu
d46fe49ab3 Fix: Memory leak in multiresbake_image_exec
MultiresBakeJob is allocated before a potential early return of the
operator, so free the data before returning.

Part of #120767

Pull Request: https://projects.blender.org/blender/blender/pulls/121102
2024-05-03 06:21:08 +02:00
Hans Goudey
43b46503f1 Cleanup: Use const for mesh selection retrieval functions 2024-05-02 22:08:25 -04:00
Campbell Barton
ad16a843c1 Cleanup: format, single quote enums & indentation 2024-05-03 11:33:23 +10:00
Campbell Barton
9918488bb1 Cleanup: use uppercase tags, following own style guide 2024-05-03 11:33:21 +10:00
Campbell Barton
5529a94f14 Cleanup: spelling in comments 2024-05-03 11:33:18 +10:00
Campbell Barton
c7de9b9f4a Reapply "GHOST/Wayland: improve the error message for protocol errors"
This reverts commit 2b85314f05cf0c4b45465dc57b881e1b3b52a605.
2024-05-03 10:55:17 +10:00
Campbell Barton
91b1077f7a GHOST/Wayland: expose wl_display_get_protocol_error function 2024-05-03 10:55:17 +10:00
Hans Goudey
f585aa7612 Refactor: Move BrushAssetShelf to properties_paint_common
Make BrushAssetShelf more easily reusable accross different space_*
UI definition files.
2024-05-02 20:53:28 -04:00
Nika Kutsniashvili
38fcaf9ab9 Fix: Python error when no active object and hitting F3
Since a3627fe88e Object menu in 3D viewport checks for
active_object.type, but if there is no context.active_object it
results in annoying python error. This PR checks for
active_object before checking type to avoid the error.

This won't be necessary once check for legacy GPENCIL is removed.

Pull Request: https://projects.blender.org/blender/blender/pulls/121370
2024-05-02 21:34:43 +02:00
Anthony Roberts
570b76f600 Enable sse2neon in BLI_simd except for hydra/USD
This should get all of the tests to pass on Windows ARM64 platforms.

Sadly it needs disabling for hydra/USD stuff as currently it doesn't play nicely with the new preprocessor. @LazyDodo suggested a USD version update may fix this, which is something I can investigate in due course - right now, let's get daily builds up and working :)

Pull Request: https://projects.blender.org/blender/blender/pulls/121361
2024-05-02 20:05:51 +02:00
Hans Goudey
39f0e3c0f4 UI: Remove more use of brush tool type icons in enum
Missing from fd5a790f36071d79315aed6e504956f8edaea717
2024-05-02 13:50:22 -04:00
Hans Goudey
fd5a790f36 UI: Remove icon usage in brush tool RNA enums
With brush assets, these tool-type icons will be removed completely.
In main already though, it makes some sense to remove the usage of
the icons in the brush tool type enum items. These icons are quite
different than the others and don't look good with a small size anyway.

As far as I can tell this doesn't make a difference in the UI anyway,
since the enum menu selector exposed in the "Brushes" panel didn't
show the icons anyway.

Pull Request: https://projects.blender.org/blender/blender/pulls/121364
2024-05-02 19:46:29 +02:00
David Murmann
aa70c687e4 Fix: Ray Portal BSDF unconnected direction wrong for OSL
Pull Request: https://projects.blender.org/blender/blender/pulls/121348
2024-05-02 19:35:02 +02:00
Julian Eisel
05b125f399 Asset Shelf: Add default preview size option
Allow changing the size of previews in a new asset shelf
when registering a new asset shelf type.

Pull Request: https://projects.blender.org/blender/blender/pulls/121358
2024-05-02 12:56:53 -04:00