Commit Graph

103368 Commits

Author SHA1 Message Date
Jeroen Bakker
4cedbb9cb7 Fix #113310: Python gpu.state.scissor_test_set Not Updating State
When using scissor_test_set the framebuffer wasn't marked dirty and
would not always translate the start to actual driver commands.

Pull Request: https://projects.blender.org/blender/blender/pulls/113642
2023-10-13 07:44:11 +02:00
Campbell Barton
63586d0f6b Fix #113309: Broken key-map after "Reload Scripts"
Regression caused by [0]. Resolve by adding a 'keep_properties' argument
to KeyConfig.update so the key-map items can be restored after the
operators have been reloaded.

[0]: 88a875ec3a
2023-10-13 14:37:07 +11:00
Campbell Barton
60a17fae47 Cleanup: add "_data" suffix to wm_keymap_item_free
Clarify that the wmKeyMapItem it's self isn't freed.
2023-10-13 14:20:29 +11:00
Campbell Barton
aebb32748e Fix UB issue calculating the frame duration for images with FFMPEG
AVFormatContext::duration was used without checking it was set,
calculations for the frame-rate cast -INT64_MAX to a double,
scaled it then cast to an integer - overflowing.
On my system the result was a negative number so the duration was never
usable in practice.

Add an explicit check for this so the duration is left at zero instead.
2023-10-13 10:55:47 +11:00
Campbell Barton
df108825c0 Fix subtle path handling bugs caused by recent changes to the title
Resolve issues with corner-cases introduced by [0].

- Comparing the filename & filepath was no longer a valid way to check
  for a directory component since the extension was stripped.
- Use BLI_path_extension_or_end which doesn't confuse extensions with
  the dot from hidden files.

The variable name include_directory was also misleading.

[0]: 1a648f5b22
2023-10-13 10:29:55 +11:00
Campbell Barton
fb58aa5900 Cleanup: typos, duplicate words 2023-10-13 10:21:06 +11:00
Harley Acheson
1c4b2ad17f Fix #113352: UI: Round Pen When Subpixel AA is Off
Testing to see if rounding the advancing pen seems to give slightly
nicer spacing when subpixel anti-aliasing is turned off.

Pull Request: https://projects.blender.org/blender/blender/pulls/113399
2023-10-12 20:54:54 +02:00
Harley Acheson
70af02e0dd Cleanup: Make format
Changes resulting from Make Format
2023-10-12 10:38:12 -07:00
Bastien Montagne
5cf3654d9d Fix USD Export crash with complex scenes, due to race condition during depsgraph building.
Building the depsgraph from non-main thread is unsafe currently, as it
may trigger some deferred processing on the Main data itself (here, the
update/resync of viewlayer collections).

So this commit moves the building of the export depsgraph back into the
main thread for the USD exporter, while keeping the depsgraph evaluation
code (which is typically the heavy part with complex scenes) into the
threaded job worker code.

Issue was randomly (but fairly commonly) reproducible when trying to export
most of the Pets project production files (on linux debug build with ASAN).

Root issue has been reported and is being discussed in #112534, ideally a
better solution can be designed at depsgraph level in the future.

NOTE: Should likely also be back-ported to 3.6 and 3.3 LTS.

Pull Request: https://projects.blender.org/blender/blender/pulls/113537
2023-10-12 19:10:37 +02:00
Harley Acheson
b688414223 UI: Type To Search And Space Bar Search
Continue allowing spacebar search for all dropdown and context menus,
but also add the ability to allow some menus to have type to search,
like Add Modifiers, Objects, Nodes.

Pull Request: https://projects.blender.org/blender/blender/pulls/113520
2023-10-12 17:54:59 +02:00
Damien Picard
2d703e9200 I18n: add label declaration to node sockets so they can be shortened
In !112591, nodes got the ability to group sockets into panels. The
labels for these sockets are automatically shortened if they begin
with the same text as their parent labels. For instance, "Transmission
Weight" will be shortened to just "Weight" because it is under the
"Transmission" panel.

While this is a good heuristic for English, it breaks down in
languages which do not have the same word order.

This commit adds a `.short_label()` callback to socket declarations so
that a shortened label can be explicitly declared.

It also adds two regexps to the translation script so that these new
fields can be extracted to the .po translation files. One extracts the
label with a translation context, the other without. Only the one
without context is currently in use.

The current automatic shortening logic is kept and will be used only
if a shortened label is not manually provided.

Fixes #112970: Node socket labels under panels are not shortened when
translated.

Pull Request: https://projects.blender.org/blender/blender/pulls/113070
2023-10-12 17:51:37 +02:00
Harley Acheson
1a648f5b22 UI: Window Title Blender Path Changes
Do not show extension of initial name, and include full file name
in the path section.

Pull Request: https://projects.blender.org/blender/blender/pulls/113560
2023-10-12 16:56:56 +02:00
Campbell Barton
59db44ad65 Fix animation player failing to play back JPEG 2000 image sequences 2023-10-13 00:02:02 +11:00
Campbell Barton
63e9de4992 Fix memory leak in the animation player when videos have no duration 2023-10-12 23:41:10 +11:00
Campbell Barton
d0507470c0 Fix crash in the animation player when a video file fails to load 2023-10-12 23:41:10 +11:00
Julian Eisel
a9238a54ba Fix broken inheritance hierarchy for light linking UI
Custom drop targets for views are supposed to use `DropTargetInterface` as the
base class, and view items `TreeViewItemDropTarget`. Light linking used
`TreeViewItemDropTarget` for both the view and the view item drop targets. This
is because they both used the same intermediate base class.

After suggestion from Sergey, this uses composition instead of multiple
inheritance, so `CollectionDropTarget` becomes a member instead of a base
class.

Pull Request: https://projects.blender.org/blender/blender/pulls/113550
2023-10-12 14:38:42 +02:00
Campbell Barton
4ea76b8530 Fix #113273: Status bar not refreshed when canceling the operation
Resolve regression in [0].

[0]: 42f8b49581
2023-10-12 17:21:34 +11:00
Jesse Yurkovich
fa987dc059 Fix #110524: Use correct typed API to retrieve python GPU buffer sizes
Large GPU buffers can overflow their dimension property due to the use
of `PyLong_AsLong` instead of `PyLong_AsSsize_t` when processing the
buffer shape.

Pull Request: https://projects.blender.org/blender/blender/pulls/113566
2023-10-12 07:44:13 +02:00
Campbell Barton
4e4fc8c276 Fix #107523: Cursor not cleared when panning stops 2023-10-12 15:59:22 +11:00
Campbell Barton
b8ad624006 Cleanup: use doxygen doc-strings, spelling in comments 2023-10-12 09:26:53 +11:00
Harley Acheson
abe53e0cca Cleanup: Make format
Just formatting changes resulting from Make Format
2023-10-11 10:33:09 -07:00
Harley Acheson
d6a6c3e1fc UI: Highlight Selected Item in View3D Mode Menu
Allow the View3D "Mode" menu to highlight the currently-selected mode.

Pull Request: https://projects.blender.org/blender/blender/pulls/112058
2023-10-11 19:27:02 +02:00
georgiy.m.markelov@gmail.com
782c9273cd Fix Hydra MaterialX error with default materials
Pull Request: https://projects.blender.org/blender/blender/pulls/113541
2023-10-11 19:10:16 +02:00
Germano Cavalcante
bdb0a05de5 Fix 'Transform Extend' not identifying the correct transformation side
Caused by c59ba19c0b.

`t->mouse.imval` was being used before initialization.
2023-10-11 13:12:51 -03:00
Harley Acheson
1b28b79768 Revert: Fix #111666: Hide Mouse in Redo Panel Inputs #113428
Reverting this as Campbell would prefer a solution that does not
involve modal cursors.

Pull Request: https://projects.blender.org/blender/blender/pulls/113551
2023-10-11 17:25:38 +02:00
Harley Acheson
aa88d9a8e3 Revert "UI: Input Placeholders"
This reverts commit b0515e34f9.
Unintentionally added to 4.0
2023-10-11 08:01:24 -07:00
Hans Goudey
50ed14f228 Fix: Set selection node crashes with attributes on the wrong domain
Remove the selection attributes on the non-selected domains, since they
will be automatically filled by domain interopolation anyway. Arguably
this should be fixed in a more general way, either by ensuring they are
always on the expected domains or more gracefully handling the case
when they aren't at a lower level. But for this node, for now this is
a simpler approach.
2023-10-11 16:51:32 +02:00
Michael Kowalski
f4124b4e20 Fix #113400: USD transform cache crash on invalid prim.
Updated CacheReader_open_usd_object() to issue a warning and
return early if the given object path does not refer to a
valid prim on the USD stage, to avoid crashing when attempting
to create a reader from an invalid prim.

Pull Request: https://projects.blender.org/blender/blender/pulls/113524
2023-10-11 16:21:19 +02:00
Philipp Oeser
40ea1cdb97 Fix #113323: Paint Secondary color not working in the Image Editor
Caused by c30d6571bb .

Above commit only updated the `BrushPainterCache` `invert` only when the
requirements for a float imbuf changed.
This however always needs to be updated.

Pull Request: https://projects.blender.org/blender/blender/pulls/113334
2023-10-11 13:35:36 +02:00
Philipp Oeser
f8d38b65a4 Fix #113255: LineStyle modifiers cannot be accessed by name anymore
Caused by 6a49041be3 .

Above commit checks an existing nameproperty for collection items, but
it does so in a way that it only checks the "parent" type. If these are
"subclassed" though, we might not have the nameproperty defined on the
"parent" class (but on the subclass instead).
Code would then error out with e.g. "FreestyleLineStyle.color_modifiers
does not support string lookups".

In the case of the report the following happened.

- linestyle modifiers (`LineStyleModifier`) can be any of:
-- `color_modifiers` / `LineStyleColorModifier`
-- `alpha_modifiers` / `LineStyleAlphaModifier`
-- `thickness_modifiers` / `LineStyleThicknessModifier`
-- `geometry_modifiers` / `LineStyleGeometryModifier`

But all of the above have subtypes, e.g.
`LineStyleColorModifier_AlongStroke`,
`LineStyleColorModifier_DistanceFromCamera`, ...
Currently, the `nameproperty` is not defined e.g. on the
`LineStyleColorModifier` (but instead on the subtypes).

Prior to 6a49041be3 (without
`RNA_property_collection_lookup_string_has_nameprop` in place),
`pyrna_prop_collection_subscript_str` could still actually find the
nameprop because it iterates into the collection and got it on the
actual Item (`LineStyleColorModifier_DistanceFromCamera` instead of
`LineStyleColorModifier`).

So while it might be possible to refine
`RNA_property_collection_lookup_string_has_nameprop` to descend into
subclasses (I didnt find an obvious way though other than scanning all
existing modifiers [not modifier types -- we would need a way to find
all types that inherit from e.g. `LineStyleColorModifier`] which kind of
defeats the purpose of checking this early), this PR moves the name
definition from the subclass to the parent class (so way from
`rna_def_modifier_type_common`) -- and this way,
`RNA_property_collection_lookup_string_has_nameprop` can properly pick
up the nameprop. It does a bit of code duplication though.

Pull Request: https://projects.blender.org/blender/blender/pulls/113290
2023-10-11 13:35:03 +02:00
Sergey Sharybin
a12a3dc73a Fix #113496: Crash in sculpt mode when Float2 attributes used on Vertices
The old logic had a hard-coded assumption that Float2 attribute is an
UV-map. This assumption is now resolved.

Pair programming session with Hans.

Pull Request: https://projects.blender.org/blender/blender/pulls/113535
2023-10-11 12:04:30 +02:00
Jacques Lucke
535d211c94 Fix #113386: separating by loose parts removes attribute data
The issue was that custom data layers were modified without checking
that the data was not shared. Now the data is unshared first.

I also added an assert to catches this kind of issue more directly.
2023-10-11 11:35:11 +02:00
Philipp Oeser
1242512ff2 Fix #113285: Mesh analysis not updating all multi-object-editing objects
The RNA update function was only taking into account the active object,
now changed to respect all `objects_in_edit_mode_unique_data`.

Pull Request: https://projects.blender.org/blender/blender/pulls/113294
2023-10-11 09:19:50 +02:00
Philipp Oeser
0e18097674 Fix #113463: VSE Hold-Split has no visual indication anymore
Exposed by cba9f47562 (but actually caused by 4d668e6825 I think).

Because of 4d668e6825 , the `StripDrawContext` `content_start` &
`content_end` were wrong for hold still regions.
These wrong extends were then used in cba9f47562 .

Now actually update `StripDrawContext` `content_start` & `content_end`
when hold still regions are in play (instead of just calling the right
functions [but not using their return values]).

Pull Request: https://projects.blender.org/blender/blender/pulls/113494
2023-10-11 09:18:39 +02:00
Campbell Barton
58442a420e Cleanup: comment for release configuration, quote-style & remove parens 2023-10-11 10:41:16 +11:00
Harley Acheson
b0515e34f9 UI: Input Placeholders
Optional inline hint describing the expected value of an input field.

Pull Request: https://projects.blender.org/blender/blender/pulls/112104
2023-10-11 00:47:13 +02:00
Campbell Barton
c006c1809d BLI_fileops: set the errno if read returns an invalid value
Set the "I/O error" if the result from read is larger than the requested
size, while unlikely - set the error so an error return always sets the
`errno`.
2023-10-11 09:04:52 +11:00
Germano Cavalcante
ab2618e186 Fix compile error due to conversion to 'long unsigned int' from 'int'
Conversion to `long unsigned int` from `int` may change the sign of the
result [-Werror=sign-conversion]
2023-10-10 12:16:31 -03:00
Bastien Montagne
a238ab737b Fix (unreported) liboverride: Hierarchy corruption when making some override local.
Making some liboverride local will break/corrupt liboverride hierarchies
in many cases. So that function (or its caller, in some cases) need to
call #BKE_lib_override_library_main_hierarchy_root_ensure to re-validate
(and re-generate if needed) the liboverride hierarchy roots.
2023-10-10 16:56:48 +02:00
Bastien Montagne
c5e10920f9 Fix (studio-reported) liboverride: hierarchy root ensure fails in some cases.
The code ensuring a valid liboverride hierarchy root ID pointer for all
liboverrides in a given Main would fail in some cases, and crash on
asserts (in Debug builds) or due to corrupted data later in code
(release builds).

The main issue fixed here is re-entry in case of dependency loops (a
same ID being checked more than once within the same chain of recursive
calls to ensure its hierarchy root is valid). Solved the usual way now,
using the intermediate 'PROCESSING' flag instead of setting immediately
the 'PROCESSED' one, when recursively processing the chain of
dependencies.

A second issue fixed in that code was that in some cases, it could leave
the invalid existing hierarchy root pointer unchanged, because it could
not find a 'valid enough' alternative.

NOTE: This data corruption is presumably caused by 'make local'
operations on liboverride hierarchy root IDs. This will be addressed as
a second commit.

For reference, issue is reproducible when opening
`/promo/splash/040_0010.lighting.splash.blend` from Pets SVN repo r3106.
2023-10-10 16:56:48 +02:00
Germano Cavalcante
02ee5a7693 Fix Snap to Face ignoring back Clip Planes
Snap to Face ignoring some clip planes is an old behavior, but it is
not desirable as the snap is made to non-visible geometry.
2023-10-10 11:30:28 -03:00
Germano Cavalcante
c351de8b2a Fix #113486: Crash snapping with clipping borders
Caused by 2cead79747

The clip_plane count in BLI_kdopbvh.c was incorrectly reduced.

To solve, make the size of the clip_plane array variable.

This eliminates the need to keep values in sync.
2023-10-10 11:30:28 -03:00
Miguel Pozo
96d6003b92 Cleanup: Draw: max_orphan_cycles clarification 2023-10-10 15:49:28 +02:00
Brecht Van Lommel
478e1ab6d3 Fix build error on Windows after BLI_read changes
Don't use posix-only ssize_t in platform independent code.

Pull Request: https://projects.blender.org/blender/blender/pulls/113493
2023-10-10 15:36:15 +02:00
Pratik Borhade
02b5ad05f6 Update drawtype when forcefield is added to empty object
For consistency, change drawtype of empty when forcefield is added to
fresh empty object.
Found this while checking #113460

Pull Request: https://projects.blender.org/blender/blender/pulls/113471
2023-10-10 15:21:41 +02:00
Campbell Barton
8d80d611e9 Use BLI_read instead of read to avoid issues with large files
Follow up to fix for #113473, similar issues exist elsewhere.
2023-10-10 22:47:35 +11:00
Campbell Barton
fa40724a72 BLI_fileops: Add 'BLI_read' wrapper to ensure the requested data is read
According to the documentation `read` isn't required to read all the
data requested. Although until recently I'd never encountered this and
none of Blender's code checks for read succeeding but not reading the
requested size.

Resolves #113473 where images over 2gb fail to load.

Ref !113474.
2023-10-10 22:27:40 +11:00
Sybren A. Stüvel
048625cc1f Anim: make bone colors library-overridable
Pose bone colors should be library-overridable, and now they are.
2023-10-10 12:05:06 +02:00
Campbell Barton
bb9b60f13d Fix build error Windows with ssize_t not being defined 2023-10-10 19:03:31 +11:00
Hans Goudey
ab9716f058 Cleanup: Access mesh bounds directly
Similar to 4eeabd274e, helps simplify fix to #111120
2023-10-10 09:31:20 +02:00