Commit Graph

120055 Commits

Author SHA1 Message Date
Bastien Montagne
b87b58b07e OBJ Export: Update 'bitflag smoothgroup' to also consider boundary vertices.
Previous code would consider two different face groups sharing no common
edges as fully isolated from each other, and could assign them the same
bitflag facegroup value.

Following FBX recent option to export these bitflags smoothgroups (!135646),
also consider that two different face groups are connected if they only share
common vertices, and assign them different bitflags values.

NOTE: This seems to be the expected behavior in major DCCs actually
using smoothgroups, only considering boundary edges create groups that
generate broken shading when imported by these tools.

NOTE: The 'unique integer identifers' option is kept for OBJ exporter,
as such OBJ files are also found on internet, depending on which app
generated them.

Pull Request: https://projects.blender.org/blender/blender/pulls/135998
2025-03-18 10:04:38 +01:00
Jesse Yurkovich
e9a21cf14c Cleanup: USD: various non-functional changes
- Use const in more places
- Use more appropriate headers and forward decls elsewhere
- Remove one instance of variable shadowing
- Rename an internal rna enum list and the USD operator property object
  to follow surrounding code and naming guidelines

Pull Request: https://projects.blender.org/blender/blender/pulls/136112
2025-03-18 07:18:19 +01:00
Richard Antalik
d267ec3ec1 Fix #135968: Sound strip offset limit is hardcoded to 0
This seems to be remains of code from time when sound offsets were
clamped to non negative values and start/endstill offsets were used to
offset strip handles from sound content.

Since start/endstill offsets were merged with start/endofs, this limit
should have been removed.

Pull Request: https://projects.blender.org/blender/blender/pulls/136015
2025-03-18 07:12:50 +01:00
Philipp Oeser
e22ff684f3 Cleanup: Anim: convert cstyle-casts
Using clang-tidy "cppcoreguidelines-pro-type-cstyle-cast" to find them.

This PR touches `bf_animrig` & `bf_editor_animation` & `bf_editor_armature`

NOTE: Also some case where untouched (not straightforward) same as
expanded macros (e.g. `LISTBASE` or `GS`)
NOTE: a couple of cases of "inconsistent-declaration-parameter" as well

Pull Request: https://projects.blender.org/blender/blender/pulls/136044
2025-03-17 19:49:45 +01:00
Jesse Yurkovich
e93c6e5f74 USD: Eliminate some unintentional VtArray copies
The `pxr::VtArray<T>` type is based on a copy-on-write scheme that is
very easy to trigger unnecessarily because of how the C++ type system
works[1].

Here we bypass unneeded copies by ensuring we always call the `const`
version of various accessor functions. The offending call-sites were
found by using the `VT_LOG_STACK_ON_ARRAY_DETACH_COPY` env variable.

This yields a very small 2-3% performance benefit when loading in a
typical, mixed-use, asset like e.g. the "4004 Moore Lane" scene.

[1] https://github.com/PixarAnimationStudios/OpenUSD/blob/dev/pxr/base/vt/array.h#L139

Pull Request: https://projects.blender.org/blender/blender/pulls/136014
2025-03-17 17:59:17 +01:00
Falk David
5d5782571e Fix #136036: Grease Pencil: SVG export not working for non-poly types
To fix this in the most non-intrusive way, we essentially do what
the modifiers do which is to convert everything to poly curves.
This is also what GPv2 used to do.

Ideally, we would export non-poly curves as bézier curves in the
supported SVG format.

Pull Request: https://projects.blender.org/blender/blender/pulls/136088
2025-03-17 17:29:52 +01:00
Clément Foucault
0105b33a5f Refactor: DRW: Move some functions to DRWContext
This reduces the API and make it more clear where there
is the global access.

This also removes some of these global access by merging
the `DRW_context_get()` calls.
2025-03-17 17:19:13 +01:00
Clément Foucault
686c571c09 Cleanup: Overlay: Remove DRWContext C-API calls 2025-03-17 16:24:23 +01:00
Clément Foucault
8d8b20f31f Cleanup: EEVEE: Remove workaround for state functions
Now the states are set accordingly inside the init function.
2025-03-17 16:24:23 +01:00
Clément Foucault
894c7fa4e2 EEVEE: Remove EEVEE Next mention inside the code
This only changes file and function names.
The EEVEE identifier is still `BLENDER_EEVEE_NEXT`.

No functional changes.
2025-03-17 15:37:04 +01:00
Jeroen Bakker
5a3fd4522c Fix #135929: Vulkan: Add support for line loops in immediate rendering
Currently only implemented for immediate mode. When used it copies the
first vertex to the last vertex to complete the loop.

Pull Request: https://projects.blender.org/blender/blender/pulls/136083
2025-03-17 15:32:49 +01:00
Clément Foucault
e08c64d68e Cleanup: DRW: Remove DrawData
These have been replaced by better alternatives overtime.

Pull Request: https://projects.blender.org/blender/blender/pulls/136073
2025-03-17 15:16:07 +01:00
YimingWu
b02c83386b Fix #136061: Modeling: Always update status bar on shear/edge slide.
When a input event is handled but `status.opmodal` is not explicitly
requested, `WM_window_modal_keymap_status_draw` will override the status
bar message, then the tool hint would be incorrect. This applies to
shear and edge slide operators. Seemingly introduced by 6d5d3ce. The
fix is to not ignore mouse move event when updating status bar as they
also causes viewport redraw.

Pull Request: https://projects.blender.org/blender/blender/pulls/136063
2025-03-17 14:29:28 +01:00
Clément Foucault
959d82f2ab Merge branch 'blender-v4.4-release' 2025-03-17 14:25:43 +01:00
Clément Foucault
e31bfce08a Fix: Overlay: Broken Shading on Armature envelope
There was a copy paste mistake in the create info refactor
patch commited in b295df7345.
2025-03-17 14:24:31 +01:00
Hans Goudey
835696f152 Geometry Nodes: Move import nodes out of experimental
The import nodes are considered complete enough to expose without
the experimental option. This commit removes the option so they will
be exposed in 4.5. There are still some possible future improvements,
including automatic caching, possibly exposing more input sockets,
and possibly including imported paths in the "Internal Dependencies"
panel. Those are considered non blocking though.

Pull Request: https://projects.blender.org/blender/blender/pulls/135957
2025-03-17 13:54:48 +01:00
Pablo Vazquez
46bd1cedf8 UI: Add unit to label in Glare (Simple Star) node
Add the unit (degree) symbol to "Rotate 45" label
to the Glare node Simple Star mode.

Pull Request: https://projects.blender.org/blender/blender/pulls/135887
2025-03-17 13:49:43 +01:00
Clément Foucault
5241133425 UI: Make area border width decoupled from scale factor
This is just the shader change.
It allows more freedom for the UI team to tweak the appearance.

The is not functional changes in this patch.

Rel #126334
2025-03-17 13:12:25 +01:00
Omar Emara
2e1dd5efee Fix: Crash when canceling compositor job
Blender crashes when canceling a compositor job if a transform node is
used. This is because freeing shared data didn't reset data members, so
it still thinks it has allocated data, which will be double freed
causing crashes. To fix this, we simply clear data members if data is
still shared.
2025-03-17 13:36:32 +02:00
Sybren A. Stüvel
7ca64d953c Fix #136041: NLA Strip Influence keyframes not appearing in tweak mode
Fix the `ANIMDATA_FILTER_CASES` macro, so that layered/slotted Actions
no longer take precedence over NLA control curves. Now they're handled
with the same priority as legacy Actions were.

Pull Request: https://projects.blender.org/blender/blender/pulls/136072
2025-03-17 11:47:20 +01:00
Campbell Barton
23de65afab Merge branch 'blender-v4.4-release' 2025-03-17 21:44:29 +11:00
Campbell Barton
5aec1308e6 Cleanup: quiet missing-declarations warnings 2025-03-17 21:44:08 +11:00
Sybren A. Stüvel
0f35ef9111 Fix #136041: NLA Strip Influence keyframes not appearing in tweak mode
Fix the `ANIMDATA_FILTER_CASES` macro, so that layered/slotted Actions
no longer take precedence over NLA control curves. Now they're handled
with the same priority as legacy Actions were.

Pull Request: https://projects.blender.org/blender/blender/pulls/136072
2025-03-17 11:42:42 +01:00
Campbell Barton
044b8ab6f0 Fix #136077: Crash transforming in background mode with an active region
Don't attempt to add region draw callbacks in background mode.
This caused by the regions runtime being null.

Even if the runtime was initialized, drawing callbacks aren't needed
in background mode.

Ref !136078
2025-03-17 21:41:34 +11:00
Sybren A. Stüvel
4e33abdafe Merge remote-tracking branch 'origin/blender-v4.4-release' 2025-03-17 11:29:24 +01:00
Christoph Lendenfeld
103826d7ab Fix: Add missing reports when running Merge/Separate Action operators
Add reports after the merge- and separate animation operators are run.
This helps to clarify that these are limited in their use with the
NLA.

The motivation for this comes from a [comment][1] on a different
issue.

[1]: https://projects.blender.org/blender/blender/issues/135894#issuecomment-1520306

Co-authored-by: Sybren A. Stüvel <sybren@blender.org>
Pull Request: https://projects.blender.org/blender/blender/pulls/135920
2025-03-17 11:26:43 +01:00
Campbell Barton
3285da11a9 Fix #136067: Crash with dynamic paint output toggle in some contexts
Resolve the crash by using the active-object to match the operators
poll functions.

Ref !136068
2025-03-17 21:17:48 +11:00
Clément Foucault
92968c23fe Refactor: DRW: Make DrawEngine a virtual class
This removes the old `DrawEngineType` and use the new `DrawEngine`
virtual class instead.

This removes a lot of boilerplate functions that were only there for
legacy reason.

To this end, some engines that were based on static functions have been
refactored into `Instance` classes. This was particularly cumbersome
for the Grease pencil engine which needed some more refactoring.

The `Engine` class that is in each namespace is a workaround to isolate
the internal implementation (i.e. the `Instance`) to the engine
modules. Without this, the whole engine is getting included in each
compile unit that includes the `Instance` class. Eventually, if we get
rid of these intricate dependencies, we could remove the `Engine` class.

Pull Request: https://projects.blender.org/blender/blender/pulls/136001
2025-03-17 10:31:22 +01:00
Campbell Barton
070a4cc9ee Merge branch 'blender-v4.4-release' 2025-03-17 20:14:50 +11:00
Campbell Barton
c8c276f56f Fix #136059: Crash clicking on the marker-region in the time line
When a marker exists always return the nearest instead of using an
arbitrary large threshold which caused region_position_is_over_marker to
crash when a non-empty marker list returned a null nearest marker.

Ref !136060
2025-03-17 20:13:08 +11:00
Jeroen Bakker
c4feddefd7 Refactor: Vulkan: Split VKWorkarounds
VKWorkarounds adds double negation. This PR splits
the struct into workarounds and extensions to reduce
confusing code.

Pull Request: https://projects.blender.org/blender/blender/pulls/136064
2025-03-17 09:06:47 +01:00
Hans Goudey
23a88e0eec Fix #136039: Grease pencil edit mode crash with Bezier curves
Caused by 5f6e94ca58.
That commit mixed up `elb` and `epb`. Hopefully with clearer
names now that mistake will be harder to make.
2025-03-16 22:39:28 -04:00
Harley Acheson
39cb672d7c Tests: Remove Unnecessary Comparison
Remove a comparison in a test that was added
accidentally.
2025-03-16 09:27:59 -07:00
Pratik Borhade
72a38aee7e UI: Increase default rows of tree view
Tree view UI of bone collection, node interface and light linking is
quite small right now. Bump the minimum row count similar to
6d8e642367

Pull Request: https://projects.blender.org/blender/blender/pulls/135426
2025-03-16 06:44:36 +01:00
Harley Acheson
2ad702808c Tests: Add BLF tests
BLF tests for font file opening, display name, metrics, variable
weight changing, width, height, advances, etc. Also tests for current
minimal word wrapping.

Pull Request: https://projects.blender.org/blender/blender/pulls/135891
2025-03-16 01:30:53 +01:00
Philipp Oeser
1448b70625 Fix #135964: "Add Paint Slot" disabled "Alpha" still adds alpha
Since internally `BKE_image_add_generated` uses 4 channel colors (no
matter what depth/planes is specified), just set alpha to 1 if the
option is unchecked.

Same as what 35dd09a9ef did for `IMAGE_OT_new`

Pull Request: https://projects.blender.org/blender/blender/pulls/135972
2025-03-15 08:54:13 +01:00
Campbell Barton
2c6b23e513 Merge branch 'blender-v4.4-release' 2025-03-15 15:26:15 +11:00
Campbell Barton
8faf210e4e Fix: crash duplicating empty hair
Attempt to access `points_by_curve.data().last()` on an empty array
crashed on a null pointer dereference.

Ref !135956
2025-03-15 15:18:03 +11:00
Ramón Klauck
dde6c2bb10 Fix: VSE: Incorrect rotation with mirrored images
When images in the VSE use mirror and then get rotated, they rotate in
the wrong direction.

Multiply rotation by X and Y component of mirror value (-1). This is
the same approach as used by translation.

Co-authored-by: Aradgus <ramonklauck987@gmail.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/136004
2025-03-15 02:32:04 +01:00
Campbell Barton
c3e5a35ecd PyAPI: add blf.bind_imbuf(..) context manager
Add support for using BLF to draw into an ImBuf image buffer.
Once the imbuf context has been set, draw calls for that font_id will draw into the image.

This works by binding an imbuf to BLF which is then used as the target when drawing.
```
with blf.bind_imbuf(font_id, imbuf):
    blf.draw_buffer(font_id, text)
```
See the example in the Python API documentation for reference.

The following BLF API's have been added to support a Python context manager.

- `BLF_buffer_state_push`.
- `BLF_buffer_state_pop`
- `BLF_buffer_state_free`

Ref !135772
2025-03-15 11:00:51 +11:00
Harley Acheson
18d82c5164 Fix #135970: Allow Allow Movement After Tooltip Timer Starts
We can only allow some mouse and pen movement once the tooltip timer
has started. Doing so beforehand can keep some tooltips from starting.

Pull Request: https://projects.blender.org/blender/blender/pulls/135997
2025-03-14 19:16:43 +01:00
Sergey Sharybin
f243f13549 Merge branch 'blender-v4.4-release' 2025-03-14 18:36:53 +01:00
Hans Goudey
759923fdd7 Geometry Nodes: Use socket type for store named grid
This used custom data types before, which was misleading and didn't
scale well because the set of attribute types is different than the set
of grid types we can store. Now just use the grid data type, like how
the store named attribute node uses the attribute type.

This covers backward compatibility, but not forward compatibility.

Pull Request: https://projects.blender.org/blender/blender/pulls/135814
2025-03-14 18:36:16 +01:00
Jacques Lucke
51904839ac Fix #135948: Geometry Nodes: support evaluating undefined custom group nodes
The main reason that didn't work before because undefined custom node groups
have the undefined `bNodeType` (and thus are ignored in various places) but are
actually still groups that can be evaluated. The fix is just to handle custom
node groups a bit more explicitly.

In the future, we may want to have a separate "undefined custom group"
`bNodetype`, but that might a be a bit bigger project.

Pull Request: https://projects.blender.org/blender/blender/pulls/135974
2025-03-14 18:31:29 +01:00
Sybren A. Stüvel
63c3db3e96 Fix #135923: Library Overrides break action constraints
Fix an issue with library overrides that was caused by Action
assignments getting versioned too late in the versioning process. Now
the versioning of Action assignments (which assigns the
created-by-versioning action slots) happens in the 'after linking'
stage, as well as in the 'after setup' stage. The latter is still
necessary for the conversion of pre-2.5x animation data.

It is likely that the versioning code can now be simplified, as the
tagging for "this needs upgrading" may no longer be necessary. We're now
too close to the 4.4 release to comfortably make such bigger refactors,
though, so I'd rather keep the overall code structure as-is.

Pull Request: https://projects.blender.org/blender/blender/pulls/135988
2025-03-14 18:26:17 +01:00
Sybren A. Stüvel
8b6e22f36e Fix: memory leak in unit test when freeing the WM
Use a cleaner approach to the WindowManager handling in the "blendfile
loading unit test" base class, to ensure it is freed properly.

The commit following this one changes the Action versioning code, which
writes to RNA properties, which in turn sends WindowManager
notifications, which in turn have to be freed properly whenever the test
exits.

Pull Request: https://projects.blender.org/blender/blender/pulls/135988
2025-03-14 18:26:17 +01:00
Bastien Montagne
dd98cede18 Merge branch 'blender-v4.4-release' 2025-03-14 18:20:26 +01:00
Bastien Montagne
8a61555a46 Fix: IMBuf: Potential buffer overflow in JPEG metadata writer.
Looks like a logic inversion mistake.

Not clear how bad this issue is, as other code related to image metadata
seems to expect 1024 char max size too (e.g. `MAX_METADATA_STR` define
in `ed_draw.cc`. But this is potentially a very bad issue, and the fix
seems safe enough for 4.4 still.

Should also be backported to active LTSs.

Pull Request: https://projects.blender.org/blender/blender/pulls/135983
2025-03-14 18:17:21 +01:00
Bastien Montagne
e85ebb24fe Cleanup: imbuf: Replace 'void' MEM_[cm]allocN with templated, type-safe MEM_[cm]allocN<T>.
The main issue of 'type-less' standard C allocations is that there is no check on
allocated type possible.

This is a serious source of annoyance (and crashes) when making some
low-level structs non-trivial, as tracking down all usages of these
structs in higher-level other structs and their allocation is... really
painful.

MEM_[cm]allocN<T> templates on the other hand do check that the
given type is trivial, at build time (static assert), which makes such issue...
trivial to catch.

NOTE: New code should strive to use MEM_new (i.e. allocation and
construction) as much as possible, even for trivial PoD types.

Pull Request: https://projects.blender.org/blender/blender/pulls/135994
2025-03-14 18:16:13 +01:00
Philipp Oeser
d79274ae53 Merge branch 'blender-v4.4-release' 2025-03-14 17:34:51 +01:00