Commit Graph

27462 Commits

Author SHA1 Message Date
Bastien Montagne
e08b91f6be Merge branch 'blender-v4.3-release' 2024-10-16 16:46:53 +02:00
Bastien Montagne
d8ad7fa39d Fix (unreported) error in 'make_local' code of the PartialWriteContext.
Found while investigating solution for #128519.

Also added comment about usage of the `MAKE_LOCAL` option itself.
2024-10-16 16:45:55 +02:00
Pratik Borhade
ee0fd0ed19 Merge branch 'blender-v4.3-release' 2024-10-16 17:23:33 +05:30
Pratik Borhade
7c9023ca41 Fix #129023: GPv3: Deselecting vgroup elements fails in stroke domain
Instead of assigning `any_point_selected` to selection span elements,
pass `select` value if any point of that curve exists in vgroup.
Also renamed `any_point_selected`->`any_point_in_group`.

Pull Request: https://projects.blender.org/blender/blender/pulls/129035
2024-10-16 13:45:28 +02:00
Campbell Barton
363b2f31b6 Merge branch 'blender-v4.3-release' 2024-10-16 21:08:12 +11:00
Campbell Barton
cbce9fb26b Merge branch 'blender-v4.3-release' 2024-10-16 21:08:02 +11:00
Aras Pranckevicius
6a1301f4c7 Refactor: factor out ffmpeg CRF/rate setting into one function
Previously the code was scattered around in places and the logic
was hard to follow. CRF values will need more remapping done on them
for future codecs and/or 10/12 bit video support, so move all that logic
into set_quality_rate_options function that does three clear things:
1) set constant bit rate if that is used,
2) set lossless mode if that is used,
3) set CRF parameters if that is used.

Pull Request: https://projects.blender.org/blender/blender/pulls/129092
2024-10-16 10:43:55 +02:00
Pratik Borhade
ceea1a4d99 Fix #129024: GPv3: Renaming a vertex group removes group assignment
GPv3 stores the vertex group inside `CurvesGeometry`.
When the object level vertex group name is changed, we have to loop over
the vertex group list of each drawing. If a matching name is
found, copy the new name to the vertex group in `CurvesGeometry`. A separate
function is created to handle this: `BKE_grease_pencil_vgroup_name_update`.

Pull Request: https://projects.blender.org/blender/blender/pulls/129038
2024-10-16 10:27:09 +02:00
Christoph Lendenfeld
41a3e6c3bd Fix #125451: Duplicating bone doesn't copy pose bone colors
When duplicating a bone (has to be done in edit mode)
the pose bone colors were not copied.
This adds the code to do just that

This also fixes it for symmetrising because that uses the
same code path

Pull Request: https://projects.blender.org/blender/blender/pulls/129007
2024-10-16 09:26:48 +02:00
Campbell Barton
11dfa3297e Merge branch 'blender-v4.3-release' 2024-10-16 17:02:56 +11:00
Campbell Barton
ccb92947c5 Fix #129067: Transforming an edit-mesh crashes with cage editing
Regression in [0] although prior to this the `deformed_only` was not
being set, caused by a separate regression.

[0]: 80fa49f24ae768c5869065363e116b51175fb2df
2024-10-16 16:57:06 +11:00
Aras Pranckevicius
db4d8d1046 Fix: Video CRF being reset when switching to AV1 codec
Two issues were present in code that was resetting CRF quality level
to "do not use CRF, use bitrate settings" mode:

- It did not include AV1 codec, so whenever you switched to AV1 the CRF
  was changing to constant bitrate.
- It wrongly included DNxHD codec. That seemed like it was trying to
  fix #100079 in 06a01168f6, but it was doing exactly the opposite
  of what a fix should have been? I don't understand it :/ In any case,
  now with DNxHD removed the CRF properly switches to constant bitrate
  when changing codec to DNxHD.

Factored the actual logic into BKE_ffmpeg_codec_supports_crf function.

Pull Request: https://projects.blender.org/blender/blender/pulls/129050
2024-10-16 05:48:51 +02:00
Sybren A. Stüvel
399c2148c3 Cleanup: run make format
No functional changes.
2024-10-15 15:12:42 -07:00
Sybren A. Stüvel
7fa5ba705e Cleanup: run make format
No functional changes.
2024-10-15 19:21:58 +02:00
Sebastian Parborg
1ca1855ca6 Merge branch 'blender-v4.3-release' 2024-10-15 18:27:04 +02:00
Sybren A. Stüvel
43d7558e5b Anim: Remove 'Slotted Actions' experimental flag
This commit takes the 'Slotted Actions' out of the experimental phase.
As a result:

- All newly created Actions will be slotted Actions.
- Legacy Actions loaded from disk will be versioned to slotted Actions.
- The new Python API for slots, layers, strips, and channel bags is
  available.
- The legacy Python API for accessing F-Curves and Action Groups is
  still available, and will operate on the F-Curves/Groups for the first
  slot only.
- Creating an Action by keying (via the UI, operators, or the
  `rna_struct.keyframe_insert` function) will try and share Actions
  between related data-blocks. See !126655 for more info about this.
- Assigning an Action to a data-block will auto-assign a suitable Action
  Slot. The logic for this is described below. However, There are cases
  where this does _not_ automatically assign a slot, and thus the Action
  will effectively _not_ animate the data-block. Effort has been spent
  to make Action selection work both reliably for Blender users as well
  as keep the behaviour the same for Python scripts. Where these two
  goals did not converge, reliability and understandability for users
  was prioritised.

Auto-selection of the Action Slot upon assigning the Action works as
follows. The first rule to find a slot wins.

1. The data-block remembers the slot name that was last assigned. If the
    newly assigned Action has a slot with that name, it is chosen.
2. If the Action has a slot with the same name as the data-block, it is
    chosen.
3. If the Action has only one slot, and it has never been assigned to
    anything, it is chosen.
4. If the Action is assigned to an NLA strip or an Action constraint,
    and the Action has a single slot, and that slot has a suitable ID
    type, it is chosen.

This last step is what I was referring to with "Where these two goals
did not converge, reliability and understandability for users was
prioritised." For regular Action assignments (like via the Action
selectors in the Properties editor) this rule doesn't apply, even though
with legacy Actions the final state ("it is animated by this Action")
differs from the final state with slotted Actions ("it has no slot so is
not animated"). This is done to support the following workflow:

- Create an Action by animating Cube.
- In order to animate Suzanne with that same Action, assign the Action
  to Suzanne.
- Start keying Suzanne. This auto-creates and auto-assigns a new slot
  for Suzanne.

If rule 4. above would apply in this case, the 2nd step would
automatically select the Cube slot for Suzanne as well, which would
immediately overwrite Suzanne's properties with the Cube animation.

Technically, this commit:
- removes the `WITH_ANIM_BAKLAVA` build flag,
- removes the `use_animation_baklava` experimental flag in preferences,
- updates the code to properly deal with the fact that empty Actions are
  now always considered slotted/layered Actions (instead of that relying
  on the user preference).

Note that 'slotted Actions' and 'layered Actions' are the exact same
thing, just focusing on different aspects (slot & layers) of the new
data model.

The "Baklava phase 1" assumptions are still asserted. This means that:
- an Action can have zero or one layer,
- that layer can have zero or one strip,
- that strip must be of type 'keyframe' and be infinite with zero
  offset.

The code to handle legacy Actions is NOT removed in this commit. It will
be removed later. For now it's likely better to keep it around as
reference to the old behaviour in order to aid in some inevitable
bugfixing.

Ref: #120406
2024-10-15 16:29:53 +02:00
Thomas Lachmann
5f84f934a8 Fix #127087: GPv3: Initialize/copy attributes when adding/duplicating layers
- set default values for attributes on new GP layer
- copy attributes when duplicating GP layer

Pull Request: https://projects.blender.org/blender/blender/pulls/128344
2024-10-15 15:08:09 +02:00
Damien Picard
5715693a97 UI: Use title case for Grease Pencil, Freestyle, Line Art
This was already the case for the vast majority of occurrences, and is
recommended by the human interface guideline's writing style.

Pull Request: https://projects.blender.org/blender/blender/pulls/129000
2024-10-15 13:00:47 +02:00
Aras Pranckevicius
f6242edf73 Fix: ffmpeg VP9 lossless flag was wrongly applied to all WebM containers
Previous fix to make VP9 lossless work (98689f51c0) applied it to
all videos that happen to be in WebM containers. While it is typical
that WebM would be used for VP9, it is not necessarily so (WebM can
have H.264 or really any other video). Do the check based on video
codec being VP9.

Pull Request: https://projects.blender.org/blender/blender/pulls/129045
2024-10-15 12:18:50 +02:00
Campbell Barton
aa6742897e Cleanup: spelling in comments 2024-10-15 16:22:38 +11:00
Campbell Barton
11e41f7276 Merge branch 'blender-v4.3-release' 2024-10-15 16:22:09 +11:00
Campbell Barton
44d0452a78 Cleanup: spelling in comments 2024-10-15 12:51:05 +11:00
Sybren A. Stüvel
5cdb950bef Anim: Fix pose library flipping with slotted Actions
Building the F-Curve cache used for pose flipping now also works with
slotted Actions. Like the pose library itself, it only considers the first
slot of the pose asset. Multi-slot pose assets are not supported.

Pull Request: https://projects.blender.org/blender/blender/pulls/128992
2024-10-14 18:26:20 +02:00
Pratik Borhade
be24e7a6a1 Merge branch 'blender-v4.3-release' 2024-10-14 17:43:54 +05:30
Pratik Borhade
373d77aeb6 Fix #128672: Brush Assets: Wrong catalogs in asset shelf by default
Mistake in `catalog_path` name

Pull Request: https://projects.blender.org/blender/blender/pulls/128681
2024-10-14 14:10:21 +02:00
Bastien Montagne
39c1127dc0 Fixes for #128078
# Fix 128078, Part I: Fix missing reverse endian switch of Action's `idroot`.

ID type code stored as ints (or shorts) need their endian switch to be
reverted (in case there is endianess conversion) on file read.
Interestingly, this was done for the deprecated IPO data (among others), but
not for the Action one!

NOTE: There is no versioning fix for this mistake, i.e. old files that
were saved from a BE system, then opened and re-saved from a LE system,
will still have totally invalid ID code values. This is not considered
as necessary currently, given that this `idroot` value is only
'informational' and not relied on by any part of the code.

# Fix 128078, Part II: GPv3 conversion code missing animation of Layers' location.

Also add code to the AnimDataConverter to ensure that actions get the
`idroot` matching their new ID owner type in GP data case.

Pull Request: https://projects.blender.org/blender/blender/pulls/128129
2024-10-14 13:59:06 +02:00
Sean Kim
6ff33b7e92 Merge branch 'blender-v4.3-release' 2024-10-11 15:25:07 -07:00
Julian Eisel
d177388979 Sculpt/Paint: Tag brushes for unsaved changes for UI indication
Part of the brush assets project followups, see #116337.

Based on feedback, it seems important to indicate to the user when a brush has
unsaved changes.

There's no reliable updating mechanism we can use or hook into here, except for
RNA "update" callbacks. Brush data gets changed in many places in code, the only
way to do this seems manual tagging every time a brush property gets changed.
This PR introduces `BKE_brush_tag_unsaved_changes()` for this. I spent some time
going through all brush properties to ensure changes call the tagging function.

A known limitation with this will be that changes to dependencies won't be
indicated in the brush. E.g. Changing the texture attached to a brush won't make
the brush be indicated as changed.

The UI to indicate the changed brushes is being discussed still, see #128846.

Pull Request: https://projects.blender.org/blender/blender/pulls/128845
2024-10-11 22:08:14 +02:00
Jacques Lucke
a239bfc4dd Refactor: Nodes: improve drawing of nodes based on node declaration
The main goal is to simplify adding support for nested node panels. The patch
makes use of the updated recursive node declarations introduced in
6ffc585fb8.

The main changes are:
* Rewritten node drawing in a way that makes ui design decisions like panel
  visibility and margins more explicit. Especially the handling of margins is
  much better now imo. Previously, it was very hard to change the margin for
  specific cases without accidentally breaking other situations. Now each
  possible case has an explicit margin. This needs a few more lines of code but
  is much easier to work with.
* Rewritten node drawing in panel (sidebar + material properties) using the new
  ways to iterate over the declaration.
* It's possible to add custom layouts at any point in the node declaration now.
  This also replaces the need for having a `draw_buttons` callback for panels.

Pull Request: https://projects.blender.org/blender/blender/pulls/128822
2024-10-11 12:20:58 +02:00
Philipp Oeser
e89cf5ecc0 Merge branch 'blender-v4.3-release' 2024-10-10 13:55:29 +02:00
Philipp Oeser
da9cf98324 Fix: assert parenting a legacy curve to an armature
The armature modifier calls `BKE_armature_deform_coords_with_mesh` (and
thus `BKE_id_defgroup_list_get`) for legacy curves as well, these are
only "riggable" via envelope weights though (this situation could be
made a bit clearer when parenting -- which is for another commit
though).

So to avoid the (rightful) assert in `BKE_id_defgroup_list_get`, only
call it in case vertex groups are supported (and possibly used later on
-- which is never the case for legacy curves).

Note: this was reported in chat by @LazyDodo because the CurveArmature
test was failing in debug

Pull Request: https://projects.blender.org/blender/blender/pulls/128792
2024-10-10 13:53:51 +02:00
Aras Pranckevicius
2d5106036f Cleanup: rename OPENEXR_COMPRESS for clarity
Rename to OPENEXR_CODEC_MASK and add comments in several places

Pull Request: https://projects.blender.org/blender/blender/pulls/128814
2024-10-10 08:45:55 +02:00
Jacques Lucke
2dd9f454c9 Refactor: BKE: use StringRef in IDProperty API
This way it's not necessary anymore to always prepare null-terminated strings
when using IDProperties.

Pull Request: https://projects.blender.org/blender/blender/pulls/128729
2024-10-10 03:17:15 +02:00
Harley Acheson
97c41218a9 Merge branch 'blender-v4.3-release' 2024-10-09 11:04:33 -07:00
Julian Eisel
2499299ff2 Fix: Empty grease pencil brush libraries linked on startup
Second part to fix #128420.

On startup, the Blender File Outliner mode would show empty libraries
linked, pointing to the brush essentials files. This was because some
grease pencil versioning code would call
`BKE_paint_ensure_from_paintmode()`, which would link in the default
brushes. Then a bit later, brush assets versioning code would remove
local brushes from the default starup file, so the library link became
empty.

Initializing paint data shouldn't necessarily include importing default
brushes. In an earlier version I made this optional with a boolean, but
it's easy enough to separate out entirely.

Now `BKE_paint_ensure()` just initializes paint data, and
`BKE_paint_brushes_ensure()` has to be called to ensure that active
brushes are available.

Pull Request: https://projects.blender.org/blender/blender/pulls/128801
2024-10-09 16:13:01 +02:00
Bastien Montagne
2b72cccc85 Merge branch 'blender-v4.3-release' 2024-10-09 15:59:01 +02:00
Julian Eisel
eac897bb38 Fix: No default brush set for vertex paint mode
Name of the default brush to use was wrong, so it wouldn't be found.
2024-10-09 14:52:33 +02:00
Aras Pranckevicius
8b275092e0 Image: Add Quality setting to EXR DWAA/DWAB compression
EXR DWAA and DWAB are conceptually similar to lossy JPG compression,
with a tunable file size vs image quality parameter. However, previously
Blender always used the fixed default setting, which is kinda similar
to very high quality (like 97) for JPG.

Internally EXR DWA/DWB quality parameter is inverted scale, i.e. 0 is
best/lossless quality, and increased setting value means decreased
quality. However the rest of Blender UI uses 1-100 JPG-like quality
scale, where values above 90 are "visually lossless", 100 is lossless,
and going below something like 50 would be visually quite lossy. So map
that to internal DWA setting:
- blender 100 -> DWA 0
- blender 97 -> DWA 45
The rest is linear relation based on those two points.

Pull Request: https://projects.blender.org/blender/blender/pulls/128790
2024-10-09 12:34:49 +02:00
Lukas Tönne
ab75dc35ea Merge branch 'blender-v4.3-release' 2024-10-09 10:28:39 +02:00
Lukas Tönne
5c57e24fea Cleanup: GPv3: Remove unused BKE functions from GPv2
Removes unused GPv2 functions in blenkernel.

Notes:
-  Functions for layer masks are still in use, but annotations never
  have layer masks in the first place. Would be good to remove the data
  structures so we can remove the functions too.
- Some multi-frame edit functions are also still nominally used, but
multi-frame editing is not an active feature for annotations. This
  should also be removed.

Pull Request: https://projects.blender.org/blender/blender/pulls/128709
2024-10-09 10:27:45 +02:00
Campbell Barton
cd9d4e992d macOS: replace BLI_expand_tilde with BLI_dir_home
Use a generic function to access the home directory making macOS path
access match other Unix systems.

When the function was added [0] it solved access to HOME when the
environment variable wasn't set. Since then support for `getpwuid()`
has been added on UNIX systems [1], which also works on macOS,
removing the need for macOS to have a separate function.

Furthermore BLI_expand_tilde had undocumented limitations that didn't
apply to other platforms (see PR for details).

Ref !128734

[0]: 9df13fba69
[1]: 6039cb17e6
2024-10-09 09:29:12 +11:00
Aras Pranckevicius
7dad51a724 IMB: Add function to scale image into a new image, use that instead of duplicate+scale
IMB_scale modifies the input image. But some places in code needed to keep
original input intact, so what they did was a sequence of IMB_dupImBuf+IMB_scale

Add IMB_scale_into_new function and use that in several obvious places:

- movieclip_build_proxy_ibuf
- icon_copy_rect
- seq_proxy_build_frame

Rebuilding proxies for VSE image sequences with 94 4K resolution EXR images
(on Ryzen 5950X/Win10/VS2022): 13.4 -> 10.3 seconds.

Pull Request: https://projects.blender.org/blender/blender/pulls/128752
2024-10-08 19:06:41 +02:00
Bastien Montagne
10c32cd120 Merge branch 'blender-v4.3-release' 2024-10-08 17:07:59 +02:00
Bastien Montagne
dbadc1c71c Fix part of #128420: invalid handling of full orphaned libraries in management code.
Reset the 'hierarchy index' runtime `temp_index` value for all library IDs.
This prevent the assert to be triggered when trying to rebuild libraries
hierarchy and there are some orphaned (i.e. not used by anything) library IDs
around.
2024-10-08 17:02:51 +02:00
Campbell Barton
82ab7ceba6 BLI_fileops: move home directory access to BLI_fileops
This was located in BKE_appdir which is higher level
(used for accessing Blender's paths), where as the home directory
may be accessed from lower level path code.
2024-10-08 12:23:40 +11:00
Campbell Barton
c0e9184e5b Cleanup: remove white-space to satisfy license checker 2024-10-08 10:06:22 +11:00
Campbell Barton
2e881eacd1 Cleanup: spelling in comments 2024-10-08 09:54:29 +11:00
Germano Cavalcante
52136d3afa Merge branch 'blender-v4.3-release' 2024-10-07 14:34:22 -03:00
Falk David
9d09362c0c Fix #128698: GPv3: Layer adjustments are applied to original geometry
Mistake in b4881f6b0a.
The function `grease_pencil_do_layer_adjustments` needs
to be called *after* creating the geometry set for
evaluation.

Pull Request: https://projects.blender.org/blender/blender/pulls/128706
2024-10-07 19:02:12 +02:00
Lukas Tönne
d7e3f55eea Merge branch 'blender-v4.3-release' 2024-10-07 18:22:17 +02:00