Commit Graph

1886 Commits

Author SHA1 Message Date
Falk David
1eb39a8689 Grease Pencil: Sculpt Mode Auto-Masking option
This implements all the auto masking options in sculpt mode.

* Stroke: Only affects strokes that are initially under the cursor.
* Layer: Only affect strokes in the same layer as the initial strokes under the cursor.
* Material: Only affect strokes with the same material as the initial strokes under the cursor.
* Active Layer: Only affect strokes in the active layer.
* Active Material: Only affect strokes that use the active material.

The `Active Layer` toggle in the toolbar has been moved to this panel.

Resolves #130022.

Pull Request: https://projects.blender.org/blender/blender/pulls/132986
2025-01-24 10:20:03 +01:00
Falk David
7878b3908b Grease Pencil: Don't show material preview as "disabled"
When locking a material, the preview icon would get greyed-out (as would
the rest of the properties in the row).
This issue is that this defeats the purpose of an accurate preview of
the material. Artists want to know what the material _actually_ looks
like.

This moves the icon into a separate row and property so that
it doesn't get disabled.

Pull Request: https://projects.blender.org/blender/blender/pulls/133478
2025-01-23 15:12:59 +01:00
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
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
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
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
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
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
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
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
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
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
be0c9174aa Cleanup: argument wrapping for Python scripts
- Wrap the closing parenthesis onto it's own line
  which makes assignments to the return value
  read better.
- Reduce right-shift with multi-line function calls.
2025-01-14 12:53:32 +11:00
Campbell Barton
6430974868 Fix failure to show the image transform menu in the sequencer 2025-01-14 12:16:39 +11:00
Damien Picard
52cb367a9b I18n: Allow translation of messages in brush settings
Two messages were not translatable because they used a string stored
in a variable, or an if/else expression.

One was translated when it should not have, because it prints the name
of a material.

Pull Request: https://projects.blender.org/blender/blender/pulls/132737
2025-01-13 12:40:51 +01:00
Damien Picard
c9a1008d51 I18n: Disambiguate "Strength"
- "Strength" in the context of Grease Pencil, deals with opacity, and
  adjusts the brush stroke alpha.
- "Strength" can mean measurable units like 'noise', 'light', etc.
- Anything else using physical strength in a generic concept.

Issue reported by Hoang Duy Tran.
2025-01-13 12:40:45 +01:00
Damien Picard
ec9c7ba465 I18n: Disambiguate "Spaces"
"Spaces" as a character in a text, not a Blender UI element.

Issue reported by Hoang Duy Tran.
2025-01-13 12:40:45 +01:00
Damien Picard
e699f0e5c7 I18n: Disambiguate "Smooth"
"Smooth" can be many things, but mostly a verb or adjective depending
on context.

Already handled in the past, but some things were missed or introduced
since then.
2025-01-13 12:40:45 +01:00
Damien Picard
c3d071e469 I18n: Disambiguate "Power"
- In the context of color balance, refers to a power function. Uses
  ID_MOVIECLIP context, because the ID_NODE is already used for math
  functions.
- In the context of the scale constraint, also a power function.
- In the context of physics and particle settings, refers to a
  falloff.
- In the context of property subtypes and units, refers to a
  quantity.

Issue reported by Hoang Duy Tran.
2025-01-13 12:40:45 +01:00
Damien Picard
88dbe8dcd1 I18n: Disambiguate "Pattern"
- "Pattern" can mean type of texture.
- It can also refer to refers to a type of matching wildcard.

Issue reported by Hoang Duy Tran.
2025-01-13 12:40:45 +01:00
Damien Picard
466af92f7a I18n: Disambiguate "Light"
"Light" already has multiple contexts, but some were missing:
- In general, "Light" refers to a Blender Light object. In many cases,
  this comes from an `id_type` enum, already using the ID context. Use
  it also for properties that were missing that context.
- In the context of render passes, "Light" is the actual illumination
  factor, not the light emitor. A new "Render Layer" translation
  context is introduced for this purpose as no existing ones are both
  specific and explicit enough.

Issue reported by Hoang Duy Tran.
2025-01-13 12:40:45 +01:00
Damien Picard
45f0d52dc8 I18n: Disambiguate "Extension"
"Extension" means how to extend an image past its bounds, as opposed
to file extension.

Issue reported by Hoang Duy Tran.
2025-01-13 12:40:45 +01:00
Damien Picard
ac419231a8 I18n: Disambiguate "End"
"End" in "Clip End" can be better translated to something like "Far"
in some languages. Using the "Camera" context even when it's not
specifically a camera clipping (also affects light probes).

Issue reported by Gorazd-Gorup.
2025-01-13 12:40:45 +01:00
Damien Picard
100d7094f1 I18n: Disambiguate "Drag"
- In the context of physics, a force.
- In the context of UI, a mouse action.

Issue reported by Hoang Duy Tran.
2025-01-13 12:40:45 +01:00
Damien Picard
3c6787fe9f I18n: Disambiguate "Box"
- In a text sequence, "Box" refers to the color rectangle behind the
  text. Reuses the "Sequence" context already used for the same thing.

Issue reported by Gabriel Gazzán.
2025-01-13 12:40:45 +01:00
Damien Picard
f833e915c8 I18n: Disambiguate "Average"
"Average" here is a verb, not a noun.

Issue reported by Hoang Duy Tran.
2025-01-13 12:40:45 +01:00
Damien Picard
ecb4984d65 I18n: Do not disambiguate some messages
- "Match Case" and "Wrap Around" were renamed but they do not need a
  translation context anymore.
- Spreadsheet tooltips with unneeded translation of format
  strings like `fmt::format(TIP_("{}"))`.
2025-01-13 12:40:45 +01:00
YimingWu
de9ded0ec8 Fix (unreported): Grease Pencil: Do not show EEVEE material slot
EEVEE material slots would be erroreously shown when there's no material
slots in a Grease Pencil object. Changed the `poll` function to prevent
this from happening.

Pull Request: https://projects.blender.org/blender/blender/pulls/132846
2025-01-13 11:05:23 +01:00
Pratik Borhade
06a2617107 Fix #100786: Collection hide viewport in properties tab
Similar to other visibility properties, include "hide_viewport" in
collection properties tab. One issue is that, when collection is
disabled, automatically parent collection is selected or tab is gone
when parent collection does not exist. The check was added in
0a903e7ab1, it doesn't seem very useful so
removed that.

Pull Request: https://projects.blender.org/blender/blender/pulls/132107
2025-01-10 14:49:43 +01:00
Omar Emara
e52bbae2bf Compositor: Only show precision for GPU device
The compositor precision option only matters for GPU device, so hide it
when in CPU mode.

Pull Request: https://projects.blender.org/blender/blender/pulls/132680
2025-01-08 07:41:48 +01:00
Campbell Barton
7b174109d1 Fix #132734: Follow Active Quads fails with non-manifold meshes
Support walking over non-manifold edge loops since calculating a
per-edge UV length only makes sense if all UV's that use that edge
are taken into account.
2025-01-08 14:02:32 +11:00