Commit Graph

2925 Commits

Author SHA1 Message Date
Clément Foucault
3d9ffa5085 Overlay: Remove legacy option and legacy code
This simply removes the old overlay engine.

Rel #102179

Pull Request: https://projects.blender.org/blender/blender/pulls/131155
2024-12-02 19:47:55 +01:00
Nathan Vegdahl
aa83738d44 Anim: change parameters of slots.new() RNA function
`Action.slots.new()` in the Python API previously took either an ID or nothing
as a parameter. In the former case it would create a slot with the appropriate
`id_root` and name for that ID. In the latter case it would create a default
slot with an unspecified `id_root` and default name.

This had several issues:

1. You couldn't create a slot with a specific `id_root` without already having
   an ID of that type. In theory this isn't a problem, but in practice in larger
   scripts/addons you don't necessarily have such an ID on hand at the call
   site.
2. You couldn't directly create a slot with a desired name without an existing
   ID with that name. This isn't so important, since you can always just set the
   name afterwards. But it's a bit annoying.
3. Most other `new()` APIs in Blender *require* you to specify the name of the
   item being created. So calling this with no parameters was violating that
   norm.
4. Ideally, we want to eliminate unspecified `id_root`s, since they cause other
   weirdness in the API such as slot identifiers changing upon slot assignment.

To resolve these issues, and just generally to make the API more
straightforward, this PR changes `slots.new()` to take two required parameters:
an ID type and a name. For example:

`slots.new(id_type='CAMERA', name="My Camera Data Slot")`.

This fully specifies everything needed for the slot identifier upon creation,
and doesn't require any outside data items to create a slot with the desired
type and name.

In the future if we decide we still want a `for_id`-style slot creation API, we
can reintroduce it as a separate function.

Ref: #130892
Pull Request: https://projects.blender.org/blender/blender/pulls/130970
2024-12-02 17:04:37 +01:00
Julien Duroure
faaa12a101 glTF: Install Draco lib in the same directory as the glTF2 addon
This changes the location of the Draco library installation path.
The new location is at the root of addons_core/io_scene_gltf2 addon, as the library is created for this addon only.

This will solve issues where the gltf addon couldn't find the library in case of global python installation or custom script/lib paths

Pull Request: https://projects.blender.org/blender/blender/pulls/131080
2024-12-02 12:50:15 +01:00
Thomas Barlow
8ed98d592e Fix #127765: FBX Export: Incorrect materials with Geometry Nodes
Geometry Nodes can change the materials of the Object, for Mesh Objects,
the new materials are present in the evaluated Object, but for non-Mesh
Objects, the new materials may not be present until the evaluated Object
has been converted to a Mesh.

This patch fixes the materials in FBX export, with Apply Modifiers
enabled, of non-Mesh types with Geometry Nodes that change materials.
Rather than getting the materials from the evaluated Object, the
materials are now retrieved from the Mesh created from the evaluated
Object.

To support object-linked material slots, the materials on the new Mesh
are replaced at the same indices as the object-linked material slots.

Pull Request: https://projects.blender.org/blender/blender/pulls/130485
2024-12-02 10:44:00 +01:00
Thomas Barlow
d0d4fc45b3 Fix #123088: Workaround for Unity FBX import per-vertex normals issue
The FBX SDK specifies that normals should use the IndexToDirect FBX
reference mode. This mode allows data written to FBX to be deduplicated
by writing a separate array of indices into the deduplicated array of
data that can be used to reconstruct the full array of data.

When Unity imports per-vertex normals with the IndexToDirect reference
mode, it erroneously considers the imported mesh's normals invalid if
any of its normals were deduplicated. This issue is not present in other
external software that I have tested.

This patch modifies the export of per-vertex normals to not perform any
deduplication, avoiding the issue in Unity's FBX importer while
maintaining use of the IndexToDirect reference mode.

The add-on's patch version has been increased.

Pull Request: https://projects.blender.org/blender/blender/pulls/123186
2024-12-02 10:40:21 +01:00
YimingWu
5370ab3248 Fix: Attribute lookup cleanup in properties_constraint.py
The match/case clean up in 2c0d2a88ca was
applied on the wrong function. This fix includes the cleanup for the
intended function.

Pull Request: https://projects.blender.org/blender/blender/pulls/131202
2024-12-02 07:44:37 +01:00
Campbell Barton
056f748e04 Cleanup: replace redundant functions with os.path.lexists 2024-12-02 12:52:21 +11:00
Campbell Barton
d63dc070ef Fix error enabling extensions with an empty wheel list
Regression in [0] caused extensions with an empty wheel list
to raise an unhandled exception when extracting the Python
version from the wheel list.

Besides resolving this error, account for errors using the wheel
list since it isn't type checked in this code-path.

[0]: cfc10b0232565642afbfdc5a867f027640ce8274
2024-12-02 12:34:31 +11:00
Philipp Oeser
c7ae26c22b Fix: python exceptions on startup
Seems like wrong syntax from 2c0d2a88ca

Pull Request: https://projects.blender.org/blender/blender/pulls/131153
2024-11-29 14:21:24 +01:00
YimingWu
2c0d2a88ca Fix #128317: Missing space_object selector in Shrinkwrap constraint
Selectors for properties `space_object` and `space_subtarget` are
missing in Shrinkwrap constraint UI panel. This was because of the
difference between property names it didn't use `space_template` to
create those selectors. Since this is just a single special case,
a branch was added in `draw_shrinkwrap` in similar fashion to display
those selectors.

Pull Request: https://projects.blender.org/blender/blender/pulls/128347
2024-11-29 13:29:55 +01:00
Campbell Barton
b295fc9a9c Extensions: use replace exists with lexists to check a path can be used
Without this, a broken symbolic-link wasn't removed, causing renaming
to fail.
2024-11-29 13:01:03 +11:00
Campbell Barton
5fa0be491e Extensions: suppress noisy prints for extension wheel filtering
These messages could flood the output even when extension installation
succeeded. Only show them when Python debugging is enabled.
2024-11-29 10:27:03 +11:00
Campbell Barton
00255b9421 Correct error printing error in f03fba614d 2024-11-29 10:26:57 +11:00
Campbell Barton
f03fba614d Fix #130211: Unhandled error installing extensions when renaming fails
Add error handling for rare but possible failures on installation.

- Account for the destination extension directory being a file.
- Handle the exception if renaming the temporary directory fails.
2024-11-29 09:56:08 +11:00
YimingWu
8fb12839f2 Grease Pencil: Add all supported modes to simplify operator
The stroke simplify operator was implemented at the beginning of GPv3
migration, which means it lacked a few other modes. This fix reused the
same code as in the simplify modifier to provide more simplify modes
back to the modifier so it can work just like GPv2.

Resolves #130616.

Pull Request: https://projects.blender.org/blender/blender/pulls/131076
2024-11-28 17:00:05 +01:00
Richard Antalik
cffaa681c5 Fix #130944: VSE box select not working with industry compatible keymap
Commit d5d81c5078 did not update industry compatible keymap data script.

Pull Request: https://projects.blender.org/blender/blender/pulls/131033
2024-11-28 14:56:16 +01:00
Campbell Barton
76f9a08963 Fix failure to reinstall an extension uninstalling the extension
When an extension could could be removed but it's directory could be
renamed, the install operation would fail anyway.

Resolve by completing the installation when the directory can be moved.

Report as part of #129884.
2024-11-28 21:28:30 +11:00
Julien Duroure
373191ff2a glTF exporter: fix KHR_animation_pointer to use the right material when texCoord
We need to store the last version of the material, when all additional data are set
2024-11-28 09:41:35 +01:00
Julien Duroure
428ec6c1e3 glTF exporter: Fix crash when animation on not used material
(And when exporting using KHR_animation_pointer)
2024-11-28 09:38:28 +01:00
Julien Duroure
7ea11a4724 glTF exporter: Always bake scene animation
This way, we can handle drivers animation
2024-11-28 09:35:38 +01:00
Julien Duroure
f7a2d0095e glTF exporter: Fix debug logging
Set INFO level if user set debug to whatever value not used to set logging level
2024-11-28 09:33:22 +01:00
Julien Duroure
ba737a496c glTF exporter: Fix armature object keep channel option
When exporting bone animation, we also check animation on armature object itself
This check was not take into account what channel are really animated
2024-11-28 09:31:23 +01:00
Julien Duroure
5997886662 glTF importer: add option to not select created objects
So, when this operator is called by other scripts in mass, we avoid performance issue
2024-11-28 09:27:29 +01:00
Julien Duroure
f8766c5542 glTF exporter: UI fixes - disable option when not available
Some combination of options are not possible, so option should be grayed
2024-11-28 09:23:14 +01:00
Julien Duroure
dbb670c6d1 glTF importer: add option to import scene extras or not
As user may want to not overwritten them
2024-11-28 09:21:19 +01:00
Julien Duroure
90e09b93b5 glTF exporter: Fix crash with extra channel 2024-11-28 09:19:41 +01:00
Julien Duroure
14302f6af7 glTF exporter: Fix crash when 'remove armature object' + 'export only def bones'
This check is done before the filter of non deformation bone.
So when we want to get this list, as it's cached, we get the list with non deformation bones, so try to access a bone that is filtered

Additional bug when we want to export only DEF bones :
the check is done on all bones, not only deformation bones, if we want to get only def bones.
So having at root a DEF and a nonDEF bone => Check will failed and said we can't remove armature

Solution: When checking if we can remove armature, indicate that we don't want to cache the result
2024-11-28 09:16:26 +01:00
Sean Kim
a820e2d393 Fix: Clone brush missing from image texture paint
Missed in 3798852071

Pull Request: https://projects.blender.org/blender/blender/pulls/131005
2024-11-27 21:25:21 +01:00
Campbell Barton
d9891aa6ad Fix #130561: incorrect Python compatibility checks for wheels
Regression in [0] caused wheels with an older Python version
that used CPython's stable ABI to be considered incompatible.

Resolve using the stable ABI for version checks.

[0]: cfc10b0232565642afbfdc5a867f027640ce8274
2024-11-27 15:44:58 +11:00
YimingWu
fc2f815b66 Fix #130513: Grease Pencil: material/vertex color pinning logic fix
When in grease pencil drawing mode, user could pin material or vertex
color to a specific brush or fill tool, but when switching tools, the
display and the logic of how those pinned material/vertex color are used
is inconsistent, leading to confusion.

The main cause of such problem is that the new GPv3 brush/fill tool is
not respecting pinning status, on top of that, user interface display
logic is also wrong. This PR makes sure that:

- Brush/fill tools respect pinning status.
- Buttons on the tool bar always display correct pinning status.
- Brush cursor will use correct color based on pinning status.

Pull Request: https://projects.blender.org/blender/blender/pulls/130968
2024-11-26 14:26:40 +01:00
Nathan Vegdahl
370a11342c Anim: rename .action_slots to .action_suitable_slots
`AnimData`, NLA strips, and action constraints all have an
`action_slots` field in RNA. The purpose of this field is to list
the slots of the currently assigned action (if any) that are suitable
for the relevant ID.

However, this is not clear from the naming. In particular, given that
there is another field `action_slot` that represents the currently
assigned slot, the name `action_slots` could be easily misinterpreted
as a way to assign multiple slots at once, which is not possible.

To help clarify its actual purpose and meaning, this PR renames the
field to `action_suitable_slots`.

As a bonus, this also ends up decluttering the Python autocomplete when
looking for things related to `action_slot`.

Ref: #130892
Pull Request: https://projects.blender.org/blender/blender/pulls/130754
2024-11-26 11:40:05 +01:00
Campbell Barton
093cb8bf43 Extensions: fix building packages containing macos universal wheels 2024-11-26 17:32:11 +11:00
Campbell Barton
64b9dbe198 Tests: correct hard coded version string in extensions test 2024-11-26 17:19:52 +11:00
Campbell Barton
0eb2491e40 Fix UV sculpt panels showing in "Misc" category, error on startup
Error in [0] intended to remove the panels but kept the space type &
region type, causing a warning on startup and the panels to be added
to a "Misc" tab.

[0]: 46773766a3
2024-11-26 15:38:58 +11:00
Pratik Borhade
d8102b8ef7 Fix #130739: Grease Pencil: MMB to confirm primitives does not work
This is due to conficting keymap. MMB was assigned for both panning and
confirm. As mentioned in a114534295, use
shift+MMB for panning.

Pull Request: https://projects.blender.org/blender/blender/pulls/130777
2024-11-25 12:11:34 +01:00
Alaska
e84103d958 Fix #130822: Update built-in Python scripts to use new EEVEE material settings
In Blender 4.3 all the EEVEE Legacy compatibility Python API calls for
materials in were removed. All Python code that makes use of that API
need to be updated to make use of the new API.

This commit updates two built in Python scripts to use the new API
to avoid errors like the one reported in #130822

Candidate for 4.3.1 corrective release

Pull Request: https://projects.blender.org/blender/blender/pulls/130873
2024-11-25 10:51:45 +01:00
Campbell Barton
0de8ae8046 Cleanup: spelling in comments 2024-11-25 13:24:46 +11:00
Campbell Barton
63090b7af6 Fix #130705: importing/exporting FBX with lights fails 2024-11-25 13:20:14 +11:00
Habib Gahbiche
35ea495bb6 UI: Nodes: Remove some snapping options
Compositor: UI: remove snapping to nodes.

Snapping nodes to other nodes behaves in a very unpredictable way, which makes most snapping options useless.

The patch removes the following:
- Snapping options `Node X`, `Node Y` and `Node XY`
- Menu `Snap Node Element`
- Menu `Snap Target`

New behavior:
- Activating `Snap` always acts as 'Snap to Grid'

Part of https://projects.blender.org/blender/blender/issues/128612

Pull Request: https://projects.blender.org/blender/blender/pulls/127667
2024-11-24 14:30:22 +01:00
Clément Foucault
409012956f Overlay-Next: Enable by default and add option to enable legacy code
The legacy option is turned off by default and will be removed
in the following weeks. It is only there to check for
regression for a short period of time. Afterward checking
for regression will require to use 4.3 as a reference.

Rel #102179

Pull Request: https://projects.blender.org/blender/blender/pulls/130683
2024-11-21 18:55:39 +01:00
Christoph Lendenfeld
f75ccd9644 Fix #130308: Missing keymap entry for bone eyedropper
Using the `E` hotkey (`I` for industry compatible) was not possible for the bone eyedropper.
This patch just adds that keymap entry for consistency.

Pull Request: https://projects.blender.org/blender/blender/pulls/130658
2024-11-21 16:48:09 +01:00
Aras Pranckevicius
ff129ff5f9 UI: Tweak VSE Text Strip UI to use panels for outline/shadow/box
The amount of settings in the text strip UI is quite large now; use collapsible (and closed by default) panels for outline/shadow/box options.

Images in PR.

Pull Request: https://projects.blender.org/blender/blender/pulls/130449
2024-11-21 09:45:04 +01:00
Nika Kutsniashvili
46773766a3 UI: UV Editor: Remove unrelated tool panels
The "Options" and "Falloff" panels only apply to UV sculpt tools
yet they were visible for all tools.

Pull Request: https://projects.blender.org/blender/blender/pulls/130499
2024-11-20 17:46:45 +01:00
Pablo Vazquez
1cd0ffd1d6 UI: Keymap Editor: Add margin from scrollbar
The "X" button to delete a keymap entry is too close to the scrollbar,
potentially leading to misclicks that would delete data.

Add margin to the right of the buttons to prevent this.
The X button is now aligned when the box is open/closed.

Pull Request: https://projects.blender.org/blender/blender/pulls/130349
2024-11-18 15:57:42 +01:00
Jun Mizutani
dcec1d5f68 Fix #130365 : Hard to read brush names in Blender Light theme
Pull Request: https://projects.blender.org/blender/blender/pulls/130366
2024-11-17 17:41:01 +01:00
kitt
140ff12eae VSE: Add Box Roundness option to text strips
The background box for VSE text strips can have rounded corners now.

Actual rounded shape is a superellipse with 2.1 exponent; this is
very close to a circle section but feels a bit nicer with more
continuity between the flat part and the rounded part of the box.

At very large rounding radius this is not very fast; optimization
for that case will come in a separate commit.

Pull Request: https://projects.blender.org/blender/blender/pulls/129665
2024-11-17 12:07:16 +01:00
Falk David
f20cd471fe Merge branch 'blender-v4.3-release' 2024-11-15 12:11:33 +01:00
Pratik Borhade
7e12131aaf Fix: GPv3: Adjustment panel in dopesheet
Missed in b4881f6b0a
Expose adjustment panel in Grease pencil dopesheet side panel as
done for others in 6e137f957f

Pull Request: https://projects.blender.org/blender/blender/pulls/130311
2024-11-15 12:10:28 +01:00
Pratik Borhade
71dd56a325 Fix: Typo in class name
Mistake in 6e137f957f
Falk noticed it in !130311

Pull Request: https://projects.blender.org/blender/blender/pulls/130315
2024-11-15 11:59:25 +01:00
Aaron Carlisle
378b62e349 Merge branch 'blender-v4.3-release' 2024-11-13 01:27:50 -05:00