Commit graph

3070 commits

Author SHA1 Message Date
Pratik Borhade
446b2a983d Fix: Variable referenced in UI code without being assigned
Mistake in d4d046a673
Right now python error is triggered with empty material slot.

Pull Request: https://projects.blender.org/blender/blender/pulls/133287
2025-01-22 10:43:09 +01:00
Julien Duroure
16f728cfe5 glTF exporter: Missed background check in previous commit 2025-01-22 09:19:32 +01:00
Julien Duroure
71d3e32974 glTF exporter: Tweak for action filter in Collection Export
Waiting a proper solution for props declaration:

- Filter now happen even if the list is not displayed
- Avoid spaming console with error, display a label saying what to do
2025-01-22 09:09:40 +01:00
Julien Duroure
748c91ce27 glTF exporter: add fallback interpolation option
Before, any sampled properties that are not keyed was exported with LINEAR interpolation
Now, user can choose the interpolation for these not keyed values (LINEAR or CONSTANT/STEP)

Example of not keyed properties: Deformation bones when animators animated other bones
2025-01-21 21:46:25 +01:00
Nathan Vegdahl
a9d72b1a14 Anim: add Action+Slot selector for Movie Clips
This adds an Animation panel to the Footage tab of the n-panel of the Movie Clip
editor. Movie Clips have various properties that can be animated, but there was
previously no way to manage the Action and Slot that held those F-Curves.

Pull Request: https://projects.blender.org/blender/blender/pulls/133380
2025-01-21 18:44:57 +01:00
Nika Kutsniashvili
693f8f37d0 Fix #133326: Material preview for Grease Pencil
Material preview panel for grease pencil was accidentally removed in e10b0b3449 because it had EEVEE engine listed as `COMPAT_ENGINES`, which also seemed accidental. After adding panel back I noticed that .blend file for generating previews was also faulty. It was updated 2 years ago when GPv3 was experimental feature, and file wasn't up to date to current state.

This PR also adds new .blend file for generating material previews that is mostly the same as one in Blender 4.2, except:
- I organized it, removed unnecessary stuff.
- For Flat preview it was using flat checkerboard background, for other modes 3D room, which seemed unnecessary and not useful for Grease Pencil, so now every mode uses flat background.
- "Cloth", "Liquid", and "Shaderball" modes in 4.2 didn't render at all and resulted in all white screen. Now they render default Circle, which is not correct, but at least better than nothing. In future we can add custom drawings to those modes for previewing materials on more complex objects.

Pull Request: https://projects.blender.org/blender/blender/pulls/133372
2025-01-21 16:34:48 +01:00
Nathan Vegdahl
b2a06888c7 Anim: add Action+Slot selector for Masks
This adds an Animation panel to the Mask tab of the n-panel of the
Movie Clip and Image editors. Masks can be animated (for example, the
opacity of a Mask Layer), but there was no way to manage the Action
and Slot that held those F-Curves.

To keep things DRY, this PR also moves the code for drawing Action+Slot
selectors from the `PropertiesAnimationMixin` class to a utility
function, which is now called from both that class and the Mask UI code.

Pull Request: https://projects.blender.org/blender/blender/pulls/133153
2025-01-21 15:12:59 +01:00
YimingWu
2114620c28 Fix: Revised logic for EEVEE/Grease Pencil material slot display
The original code path could evaluate `ob.type` when `ob` was `None`.
Now fixed so this should not happen.

Continuation of:
https://projects.blender.org/blender/blender/pulls/132846
2025-01-21 21:04:31 +08:00
Campbell Barton
84c9e6e655 Cleanup: use single quotes for enums 2025-01-21 23:50:17 +11:00
Lukas Tönne
bca8fc76f9 Fix #130323: Make Grease Pencil interpolate tool retain point distribution
The interpolate tool was using a linear re-sampling of the curves, which changes
non-uniform point distributions can causes unexpected shifts in points along the
curve, even very close to an input stroke (mix factor ~0 or ~1).

This patch adds an alternative interpolation function with explicit segment
indices and fractions, which can then be computed by the interpolation tool.
The point segment factors are chosen such that each point of the input strokes
has an exact matching point in the interpolation. When the factor is close to
0 or 1 the shape of the curve thus matches the respective input exactly.

This approach is more similar to what GPv2 did, except instead of sub-dividing
each segment it simply generates a _local_ uniform sample to fit more points
into the same segment. These extra points are colinear at the extremes of the
mix factor range, so the curve matches the input curves visually.

Pull Request: https://projects.blender.org/blender/blender/pulls/130594
2025-01-21 13:36:37 +01:00
Campbell Barton
abd933d6b0 Cleanup: prefer parenthesis over line continuations in Python scripts 2025-01-21 23:30:55 +11:00
Campbell Barton
70f44c6204 Cleanup: use operator_enum to avoid inlining values 2025-01-21 23:24:31 +11:00
Campbell Barton
0d0f8fa8f4 Cleanup: remove unused function in pose_library
Ref !133145
2025-01-21 23:06:29 +11:00
Nika Kutsniashvili
5e5c68fa62 UI: Expand brush/tool falloff curve presets in popovers
Expand falloff curve presets for brush/tools, to match other falloff
types such as proportional editing.

Pull Request: https://projects.blender.org/blender/blender/pulls/130905
2025-01-21 12:41:05 +01:00
Pablo Vazquez
e2e992a425 UI: Add icons to Batch Rename data type menu
Add icons to better identify data types in the Batch Rename type menu.

Makes it easy for users to recognize icons they are already familiar
with, especially when following tutorials in English while using a
translated UI.

Also fixes 'Light' being singular, while others were plural.

Pull Request: https://projects.blender.org/blender/blender/pulls/130300
2025-01-21 11:31:24 +01:00
Falk David
b9f253564e VSE: Python API: Deprecate sequence properties and replace with new ones
This PR adds new RNA properties that deprecate and replace any `sequence` property.
The old prooperties are still there and fully functional, but the description is changed
to indicate that these will be removed in the future and that the new properties should
be used instead.

| Deprecated property | Replacement property |
| --------------------------------- | ----------------------------------- |
| `context.active_sequence_strip` | `context.active_strip` |
| `context.selected_editable_sequences` | `context.selected_editable_strips` |
| `context.selected_sequences` | `context.selected_strips` |
| `context.sequences` | `context.strips` |
| `SequenceEditor.sequences` | `SequenceEditor.strips` |
| `SequenceEditor.sequences_all` |  `SequenceEditor.strips_all` |
| `MetaStrip.sequences` | `MetaStrip.strips` |

Previously, rna paths for animation data on strips started with `sequence_editor.sequences`.
This PRadds versioning for the rna paths to make sure to use
the new naming scheme. This does mean that in previous versions of blender,
the animations don't show but the data is not lost (even if the file is saved in the older version).

Also do some cleanup of existing python scripts inside the source to use the
new properties.

Part of #132963.

Pull Request: https://projects.blender.org/blender/blender/pulls/133156
2025-01-21 11:30:20 +01:00
Pratik Borhade
8dde2f6689 Fix #114901: Shortcut assigned to pack island not showing in menu
`wm_keymap_item_find_props()` finds the keyitem for respective operator.
This function expects opcontext to be `WM_OP_EXEC/INVOKE_REGION_WIN`.
Set operator_context to `INVOKE_REGION_WIN` in UI drawing code for pack
island button, this will allow drawing shortcut key infront of the label.

Pull Request: https://projects.blender.org/blender/blender/pulls/133298
2025-01-21 01:57:56 +01:00
Nathan Vegdahl
9f2ab9cba0 Anim: rename RNA Slot.id_root to Slot.target_id_type
The name `id_root` was not descriptive, and was just a hold-over from the
equivalent (now deprecated) property on the Action itself.  `target_id_type`
is more clear, reflecting that this is the type of ID the Slot is intended
to animate.

This PR also renames the corresponding `id_root_icon` to
`target_id_type_icon`.

Note that this PR updates the GLTF import/export core addon to adhere to
these name changes as well.

Pull Request: https://projects.blender.org/blender/blender/pulls/133164
2025-01-20 15:24:08 +01:00
Nathan Vegdahl
1ac5b45eae Anim: add Action+Slot selector for Compositing Node Tree
This allows users to manage the Action and Slot assignment of a Scene's
compositing nodes. The selector lives in the Animation Panel in Scene
Properties, alongside the Action+Slot selector of the Scene ID itself.

Pull Request: https://projects.blender.org/blender/blender/pulls/133141
2025-01-20 15:18:21 +01:00
Sybren A. Stüvel
fc44eb910d Anim: Copy Global Transform, use slotted Actions correctly
The operators of the Copy Global Transform add-on now use slotted
Actions.

Pull Request: https://projects.blender.org/blender/blender/pulls/133308
2025-01-20 14:05:30 +01:00
Sybren A. Stüvel
84af3a41b0 Anim: Copy Global Transform, correctly restore scene after Fix to Camera
After using the Fix to Camera operator, restore the transform matrices
of the fixed-to-camera objects/bones. This is necessary as the
autokeying options (like 'Only Available') may limit the keys that are
set, and thus going to the original scene frame may not be enough to
restore the full transform.
2025-01-20 14:05:30 +01:00
Sybren A. Stüvel
04e9c5cca2 Anim: Copy Global Transform, remove unnecessary exception handling
No functional changes, as the documented reason the exception handling was
there isn't appliccable any more.
2025-01-20 14:05:30 +01:00
Sybren A. Stüvel
e8019814bd Anim: Copy Global Transform, fix MyPy warnings
No functional changes, except that a rare error case is now handled
correctly.
2025-01-20 14:05:30 +01:00
Pratik Borhade
9439ff09e9 Fix #133259: Regression: Error when saving a theme
Missed in 655a17a6ab.

Pull Request: https://projects.blender.org/blender/blender/pulls/133285
2025-01-20 10:35:27 +01:00
Campbell Barton
90b03d2344 Cleanup: spelling in comments 2025-01-20 11:19:23 +11:00
Campbell Barton
05efd19982 Cleanup: hide unused variable, correct comment 2025-01-20 11:19:06 +11:00
Pratik Borhade
c479e0c2de Fix #132545: Grease Pencil: Change primitive tool radius/strength with hotkey
Move keymap for brush radius/strength out of `km_grease_pencil_brush_stroke`.
Poll function of it skips primitive tools (see:`keymap_grease_pencil_brush_stroke_poll`)

Pull Request: https://projects.blender.org/blender/blender/pulls/132589
2025-01-19 10:00:18 +01:00
Pratik Borhade
386365aece Fix #133203: Call invoke function for transfer mesh data
Use operator context of 'INVOKE_DEFAULT' for object.data_transfer and
object.datalayout_transfer in menu VIEW3D_MT_make_links so that they
work correctly when called from popup menus.

Pull Request: https://projects.blender.org/blender/blender/pulls/133228
2025-01-18 19:58:35 +01:00
Jacques Lucke
09e4747fc4 Fix: inconsistent UI in Copy on Duplicate panel in User Preferences
Generally, checkbox labels are not grayed out when they are not checked. Better
be consistent with other parts of the UI here. When I saw this, I was first
confused because it looked like I can't enable the values that are not checked.

This was introduced in #112393.

Pull Request: https://projects.blender.org/blender/blender/pulls/132180
2025-01-17 12:14:37 +01:00
Pratik Borhade
d4d046a673 Grease Pencil: Allow editing locked material properties
As discussed in #132721, properties of locked materials should
be editable (similar to locked layers)

Pull Request: https://projects.blender.org/blender/blender/pulls/132724
2025-01-17 11:02:44 +01:00
Brecht Van Lommel
a6b293daac Python Module: Bundle VFX library python bindings
When calling bpy.utils.expose_bundled_modules(), these modules are
added to sys.path.

This provides a solution/workaround to two problems:
* Using bpy together with packages like usd-core is problematic. Besides
  crashing due to C++ symbol conflicts, it's just impossible to import
  different versions of the same module, or to have distinct environment
  variables for both. (#127132)
* Blender add-ons using these VFX modules do not currently work with
  the bpy module.

This adds about 15MB to the bpy package.

Pull Request: https://projects.blender.org/blender/blender/pulls/133082
2025-01-17 10:13:31 +01:00
Harley Acheson
6727676740 Fix #129579: Improvement to Changed Brush Display
Changed custom sculpt brushes currently shows "*Unsaved Changes" as a
label that can overlap with the "Brush Assets" header. This PR makes
the header text show as "Brush Asset (Unsaved)" in this circumstance.

Pull Request: https://projects.blender.org/blender/blender/pulls/131119
2025-01-16 23:19:24 +01:00
Julien Duroure
312289ca60 glTF export: fix recursivity check on gpu instances 2025-01-16 21:34:45 +01:00
Julien Duroure
4dccaf5fae glTF export: ignore variant extras 2025-01-16 21:29:37 +01:00
Julien Duroure
b71d8484e2 glTF exporter: make sure color is white if only alpha is used 2025-01-16 21:26:54 +01:00
Julien Duroure
96369594f4 glTF import: tweak option UI 2025-01-16 21:25:12 +01:00
Julien Duroure
3f68656c7a glTF export: add keep named node flag for gltfpack 2025-01-16 21:24:00 +01:00
dupoxy
40b0185a8e UI: Add asset browser option to remove the preview of asset
Allow user to remove the preview of an asset from the asset browser details region.
Additionally, user can now reuse the default icons after adding a preview.

Pull Request: https://projects.blender.org/blender/blender/pulls/132575
2025-01-16 20:32:40 +01:00
Harley Acheson
53fdb68bd0 Fix #79977: Light Theme NumSlider InnerSel
Slight brightening of the Light Theme Value Slider Inner Selected color
so that it can indicate which of multiple items are selected.

Pull Request: https://projects.blender.org/blender/blender/pulls/131338
2025-01-16 17:18:37 +01:00
Falk David
d3ba70190b VSE: Python API: Rename RNA types from Sequence to Strip
This PR renames `bpy.types` that contain `Sequence` (and refer to a strip) to `Strip`.

The `bpy.types.Sequence` has already been renamed to `bpy.types.Strip` in
a previous PR. See !132179.

Additionally, this PR does some cleanup renamings in the sequencer
RNA files (e.g. `sequence` -> `strip`).

Part of #132963.

Pull Request: https://projects.blender.org/blender/blender/pulls/133054
2025-01-16 12:32:59 +01:00
Campbell Barton
481a8b67d4 PyAPI: add bpy.app.portable, derived from WITH_INSTALL_PORTABLE
Support differentiating between portable & system installations,
useful to properly locate relative paths which would not work
on system installations.

Ref !133143
2025-01-16 21:07:29 +11:00
Casey Bianco-Davis
3f8b95f8c2 Grease Pencil: Option to subdivide last segment when closing stroke
Adds a option to add new points on the last segment to match point density.
This matches the legacy grease pencil operator.

Resolves: #125262

Pull Request: https://projects.blender.org/blender/blender/pulls/133026
2025-01-16 11:06:41 +01:00
John Kiril Swenson
1fc1878cd6 VSE: Add effect/transition UI/code cleanup
Part of the Jan 2025 Code Quality project described in #130975.

This patch aims to improve user-facing messaging when adding effects or
transitions, properly polling them out based on context, and avoiding
unnecessary error messages when possible.

- Rearrange "add Effect Strip" UI in order of required number of
  selected strips to create the effect strip, from 0 -> 1 -> 2
- Properly poll out these operators if not enough non-sound strips (i.e.
  any strips with video content) are selected.
	- Note that this does not require any extra iterations over the
	  entire seqbase.
- Gracefully avoid errors with trying to add effect/transition strips
  when sound strips are part of the selection: for example, when the
  user has selected connected strips.
	- In these cases, it is clear that the user wishes to operate on
	  the strips with video content.
- Refactor `seq_effect_find_selected` to fix bugs and account for all
  cases, removing TODOs in place. Rename it `seq_effect_get_new_inputs`
  to more accurately express its purpose.
- Rename various `last_seq` to `active_strip` to adhere to new conventions
  laid out in #132736
- Update UI tooltips for effect, transition, and fades to make their use
  clearer.

Pull Request: https://projects.blender.org/blender/blender/pulls/132672
2025-01-16 01:40:36 +01:00
Pablo Vazquez
ef2bff2004 UI: Always display mesh indices overlay setting
Show the Indices overlay setting regardless of Developer Extras being
turned on or not.

With the introduction of Geometry Nodes, having access to the indices
is handy outside of development environments (as well as in game
development or to debug i/o issues).

Pull Request: https://projects.blender.org/blender/blender/pulls/133095
2025-01-15 16:05:44 +01:00
Philipp Oeser
e700e1f71c Fix #115843: Expose curves sculpt collision distance
The hardcoded value doesn't work well with real scale human heads for
example (was already adjusted once in a76b5d3a07).
The result for too high values is a complete "freeze" of the whole curve
(since  the solution from e7606139ba has the problem that it keeps
running into max iterations of the collision solver).

As long as no better solver is implemented, it is better to have an
adjustable value (to work on differently sizes objects) to not run into
the above issue (same as the old particle hair system had) and show it
in sculptmode next to the button which enables collision.

This is done per `Curves` (same as the flag
`CV_SCULPT_COLLISION_ENABLED`), similar to symmetry settings
[alternatively, it could be part of `BrushCurvesSculptSettings` but I
think it makes more sense in Curves] and then passed on to the
`CurvesConstraintSolver`.

Includes versioning code (to set the default for old files).

Pull Request: https://projects.blender.org/blender/blender/pulls/132997
2025-01-15 15:54:43 +01:00
Nika Kutsniashvili
89f829f736 Nodes: Node Wrangler: Remove "Frame Selected" operator
This operator was duplicating feature that already exists in core
Blender (`node.join`), and was not working great as well. So there is
no need to maintain this python operator, but to keep consistency for
users I kept the keymap and UI entry but assigned it to `node.join`
operator instead, so that users don't notice change.

I assigned keymap inside add-on and not in Blender core because people
who didn't use Node Wrangler have that key free, or have something else
assigned (and `node.join` is already mapped to Ctrl+J), so only Node
Wrangler users should have this keymap. We can change it and rename
built-in operator to Parent, instead of Join, and remap it to Shift+P,
but that's separate discussion.

Resolves #129404.

Pull Request: https://projects.blender.org/blender/blender/pulls/132758
2025-01-15 02:19:33 +01:00
jlalleve
2feadc623b Core: Environment variables for deployment
* BLENDER_SYSTEM_SCRIPTS support for multiple script paths, separated by
  ; on Windows and : on other platforms.
* New BLENDER_CUSTOM_SPLASH to replace the splash screen image.
* New BLENDER_CUSTOM_SPLASH_BANNER to overlay an image on the splash.

Contributed by Sony Interactive Entertainment: https://github.com/PlayStation-OpenSource
2025-01-14 20:57:31 +01:00
Harley Acheson
1c64f8cbb5 Fix #127231: More Space for Frame Column in Shape Key List
As the complaint shows, using default layout the column for absolute
keys in the Shape Keys list gets cut off. This PR increases this space
by changes to alignment and column split factor.

Pull Request: https://projects.blender.org/blender/blender/pulls/131887
2025-01-14 20:43:33 +01:00
Nathan Vegdahl
1cb25d6245 Anim: declutter Action Editor header
The Action Editor was already getting crowded, but has become even
moreso with the addition of the new Slot selector. Part of this clutter
is due to the NLA-related buttons:

- The up/down track switching buttons.
- The Push Down button.
- The Stash button.

The latter two are currently still useful, but don't need to be directly
on the header itself. This PR moves them to the header's Action menu.

The up/down buttons have several issues:

- They are conceptually confusing: you cannot visually see what's
  happening or which track you're on without an NLA editor open anyway,
  so somewhere in the NLA Editor would be a better place for them.
- Their functionality is broken, and it seems has been for a long time:
  you can go down in the track stack, but often can't go back up,
  despite the existence of the up button. It doesn't appear that anyone
  has reported this cripplingly broken behavior, which strongly suggests
  that very few people (if anyone) is using or relying on these buttons.
- They don't make any sense when you have more than one strip on a track
  anyway (which strip do you go into tweak mode on?).

For all these reasons, this PR simply removes the up/down buttons.
2025-01-14 17:15:45 +01:00
Campbell Barton
d18fb4010c Keymap: resolve nurbs edit-mode conflict between "Repeat" & "Select Row"
Use "Ctrl-Shift-R" for select row so the "Repeat" shortcut is available.

Resolves #83123.
2025-01-14 17:56:10 +11:00