Commit Graph

1006 Commits

Author SHA1 Message Date
Bastien Montagne
f9c3d51322 I18N: utils: Fix invalid timestamp format in PO files.
Expected format is `%Y-%m-%d %H:%M%z`.

Previous code would not generate the expected format of timestamps for
PO files headers (specifically in the the `POT-Creation-Date` field).

This could lead to some parsers (like e.g. the `sphinx_intl.load_po`
function) failing to load these PO files.

Note: since `datetime` module requires additional gymnastic to get valid
timezone info,switched back to the simpler `time` module here.

All times are expressed in UTC (aka GMT) timezone, since these are also
the values stored for Blender buildtimes.

Reported by @hoanguk in the Blender translations chat, thanks.
2024-01-18 11:20:26 +01:00
Campbell Barton
54349d0287 UI: don't gray out "Revert to Saved Preferences" with factory startup
This made it seem as if it wasn't possible to load from saved
preferences when running Blender with '--factory-startup'.

This isn't a perfect solution as loading the saved
preferences doesn't clear `bpy.app.factory_startup`.
Even so, it's better not to gray out a menu item which is functional.
2024-01-18 13:37:15 +11:00
Damien Picard
8564e03cdf Fix FPS menu in "Format" panel not following translation setting
The FPS menu was using a cached value which wasn't being refreshed
when translation changed.

Add `bpy.app.handlers.translation_update_post` handler which runs
when translation changes, this can be used to clear any cached UI
values.

Ref !117049
2024-01-18 11:31:38 +11:00
Campbell Barton
d068407a00 Fix #114801: Scene.use_audio value flipped
Regression in [0] caused the value to be flipped.

[0]: e37dc17991
2024-01-18 11:01:13 +11:00
Harley Acheson
8ba7e40bb4 Revert #106653: Cleanup Dialog to Manage Orphaned Data
Reverting 58e1e88dc3 because of concerns by reviewer.

Pull Request: https://projects.blender.org/blender/blender/pulls/117241
2024-01-17 17:05:24 +01:00
Campbell Barton
5149aed4ac PyAPI: improve warnings when addons from extensions repos fail to load 2024-01-17 18:30:16 +11:00
Harley Acheson
58e1e88dc3 UI: Cleanup Dialog to Manage Orphaned Data
Creates a new "Cleanup" dialog that allows purging unused data blocks,
as well as a window used for managing unused data blocks.

Pull Request: https://projects.blender.org/blender/blender/pulls/106653
2024-01-17 01:09:12 +01:00
grady
796577d76e Outliner: Double-click on item icon to select contents/hierarchy
Allow double-clicking on Outliner items to select all child items.

Pull Request: https://projects.blender.org/blender/blender/pulls/110151
2024-01-17 00:45:43 +01:00
Campbell Barton
0d7225bf0c Cleanup: remove outdated comment
String suggestion now allow the operator list to be searched.
2024-01-17 10:30:04 +11:00
Lukas Tönne
c02f3c94d9 GPv3: Opacity modifier
Opacity modifier implementation based on GP2.
Functionality is largely unchanged.

_Color Mode_ is either `Stroke` or `Fill` for modifying color opacity or
`Hardness`.
_Uniform Opacity_ does two things at once (!):
- Sets the same opacity value for every point in a stroke.
- Sets opacity as an absolute value rather than a factor.

_Weight as Factor_ (button to the right of Opacity Factor): Use the
vertex group as opacity __factor__ rather than an overall __influence__.
This is confusing and hard to convey, but copies behavior from GP2.

The _Influence_ panel contains the same filter settings as the GP2
modifier, with some small changes:
- _Layer_ selects only strokes in the respective layer (with an _Invert_
  option)
- _Material_ selects only points with the respective material (with an
  _Invert_ option)
- _Layer Pass_ and _Material Pass_ select only strokes/points which are
  rendered in the respective pass.
  _Note 1: Layers don't have UI for setting a pass yet, this will be a
  generic layer attribute. This can be set through the API for testing._
  _Note 2: In GP2 a pass value of zero was used to disable pass filters.
  Since zero is a valid pass ID an explicit flag has been added for the
  purpose of turning pass filters on and off._
- _Vertex Group_: This can be used as an additional influence filter on
  points. If _Weight as Factor_ is enable the vertex group instead
  replaces the opacity factor. In _Fill_ mode the vertex group weight of
  the stroke's first point is used as influence for the entire stroke.
- _Custom Curve_ is another possible influence factor per point. The
  curve input value is the relative position of a point along its
  stroke.

The Influence settings have been moved into a separate DNA struct, which
should help with reusability in various modifiers. Various utility
functions can be found int `MOD_grease_pencil_util.hh` for handling
influence settings and generating `IndexMasks` for modernized C++ code.

Pull Request: https://projects.blender.org/blender/blender/pulls/116946
2024-01-16 16:56:14 +01:00
Pedro A
6d63da40ee Fix: error when custom socket has no 'draw' function
This `draw` method is optional. The same check is also done elsewhere.

Pull Request: https://projects.blender.org/blender/blender/pulls/117061
2024-01-16 15:41:03 +01:00
Lukas Tönne
53e34dba80 Fix #115727: Draw panel buttons in the node editor side bar
In 13fac109 the node panels got support for individual option button
callbacks, but these were not included in the node editor side bar.
Only the older top-level buttons are drawn there.

The panel structure is currently not accessible in python since it is
part of the `NodeDeclaration` system. To draw node input sockets and
buttons in the correct panel order as they appear on the node, a new
template function `uiTemplateNodeInputs` has been added. This iterates
over declared panels and their contents in the appropriate order and
draws the buttons before sockets in the same panel.

Pull Request: https://projects.blender.org/blender/blender/pulls/116936
2024-01-16 13:37:57 +01:00
Campbell Barton
489408e8d3 PyAPI: handle sys.exit() from the Python console
This would raise a SystemExit, showing it's stack trace into Python's
code module, then a syntax error on any input immediately afterwards.

Now exception is printed & the input for the Python console is reset.

Address some issues raised by #109435.
2024-01-16 17:17:54 +11:00
Sybren A. Stüvel
acbb91b192 Fix: Anim, replace last arm.collections.all with arm.collections_all
Replace the last occurrences of `arm.collections.all` to
`arm.collections_all`. This has been the API since
015555b07a.
2024-01-15 11:36:48 +01:00
Campbell Barton
0efb5a39e2 UI: show shortcut for "View Selected" in the pie menu
Remove redundant use_all_regions property in the key-map,
while this isn't wrong it causes the properties not to match
the pie menu item, the shortcut then fails to display.
2024-01-15 14:35:23 +11:00
Richard Antalik
daa0219a57 VSE: Add retiming operator macros
Add retiming_add_freeze_frame_slide and retiming_add_transition_slide
operator macros to move keys after adding, instead of using fixed
duration.
2024-01-14 19:47:49 +01:00
Aaron Carlisle
67b21ce54d UI: Clarify Liquid Diffusion/Viscosity Properties
The viscosity panel was confusing for users because viscosity
is defined by the base and exponent properties in the Diffusion panel.

What this setting actually does is use a special solver algorithm that is designed for high viscosity liquids.
See 635694c0ff for details.

The below changes are designed to better represent this to the user.

- Move the "Viscosity" Panel to a sub panel of "Diffusion"
- Rename "Viscosity" to "High Viscosity Solver" to better represent what this property does
- Update `use_viscosity` tooltip to better explain that this uses a different solver algorithm.

Pull Request: https://projects.blender.org/blender/blender/pulls/116118
2024-01-12 16:55:05 +01:00
Iliya Katushenock
37b2c12cfa Geometry Nodes: Sort Elements node
Implements the design in #109983

Pull Request: https://projects.blender.org/blender/blender/pulls/114194
2024-01-12 14:30:34 +01:00
Jeroen Bakker
024e12b53e Cleanup: Make format 2024-01-12 13:49:06 +01:00
Antonio Vazquez
814ff41ed5 GPv3: Add Assign material menu
Adds a menu to assign a material from a list as is in GPv2.

Related to #114190.

Pull Request: https://projects.blender.org/blender/blender/pulls/114637
2024-01-12 13:40:00 +01:00
Damien Picard
3bd41cf9bc I18n: Go over TIP_ and IFACE_ usages, change to RPT_ when relevant
The previous commit introduced a new `RPT_()` macro to translate
strings which are not tooltips or regular interface elements, but
longer reports or statuses.

This commit uses the new macro to translate many strings all over the
UI.

Most of it is a simple replace from `TIP_()` or `IFACE_()` to
`RPT_()`, but there are some additional changes:
- A few translations inside `BKE_report()` are removed altogether
  because they are already handled by the translation system.
- Messages inside `UI_but_disable()` are no longer translated
  manually, but they are handled by a new regex in the translation
  system.

Pull Request: https://projects.blender.org/blender/blender/pulls/116804

Pull Request: https://projects.blender.org/blender/blender/pulls/116804
2024-01-12 13:37:32 +01:00
Damien Picard
5db82be74f Fix #76101: I18n: add new preference to translate reports
Translation of the UI is currently split into 3 preferences:
interface, tooltips, and new data. The distinction between interface
and tooltips is currently unclear as tooltips also include a lot of
messages not displayed in the actual tooltips on mouse hover.

These include reports to the Info Editor, information in editor
headers and footers, and statuses in panels.

In order to limit the use of `TIP_()` to actual tooltips, this commit
introduces a new preference for this extra information: "Reports".

New translation macros are introduced: `RPT_()` and `CTX_RPT_()`, as
well as their equivalent for the Python API, `pgettext_rpt_()`, to be
imported as `rpt_()`.

Pull Request: https://projects.blender.org/blender/blender/pulls/116804
2024-01-12 13:37:29 +01:00
Antonio Vazquez
c964b79edf GPv3: Copy Materials to Selected operator
Conversion of GPv2 operator to duplicate materials between grease pencil objects.

Pull Request: https://projects.blender.org/blender/blender/pulls/115535
2024-01-12 11:20:35 +01:00
Casey Bianco-Davis
33b4964c0c GPv3: Sample color
This adds the ability to use the `sample color` operator in GPv3

Pull Request: https://projects.blender.org/blender/blender/pulls/116235
2024-01-12 11:11:55 +01:00
Hans Goudey
6438d0ad1f Cleanup: Grammar in comments 2024-01-11 11:01:50 -05:00
Pratik Borhade
3d018fd0c7 GPv3: Expose subdivide operator in UI
Missed in 991902cb28

Pull Request: https://projects.blender.org/blender/blender/pulls/117013
2024-01-11 12:06:28 +01:00
SebastianWitt
406a2fde91 UV: improve performance for lightmap unwrap
Replaces this search by representing the 3 edge lengths of each triangle
as 3d points and searching with a KD-tree.

On a mesh with ~20k Tris the old method runs in 40s while the new method
takes 0.23s with a difference of <0.001%.

Ref !113720
2024-01-11 10:32:07 +11:00
SebastianWitt
7fa2a1071e Fix divide by zero error Lightmap Unwrap & small N-gons
Ref: !113716
2024-01-11 10:14:21 +11:00
laurynas
0d964f91a2 Curves: Add extrude operator
Adds extrude operator to new curves. Press key E in edit mode to invoke.
It works correctly on Bezier curves also, but result is weird as there is no
way to control Bezier handles interactively. Currently operator works the
same way as in old curves.

Algorithm idea is same as in https://archive.blender.org/developer/D15524

Pull Request: https://projects.blender.org/blender/blender/pulls/116354
2024-01-10 17:26:54 +01:00
laurynas
70fe812ef1 Curves: Add "As NURBS" option to draw tool
Add an option to output curves as NURBS instead of Bezier. The same
fitting algorithms are used. The only difference is that the drawing
result is a NURBS curve with Bezier knot mode, instead of a native
Blender Bezier curve.

Pull Request: https://projects.blender.org/blender/blender/pulls/116696
2024-01-10 13:59:59 +01:00
Bastien Montagne
fc0ad04d30 Cleanup: Python Style: Fix lint buildbot error. 2024-01-10 10:45:07 +01:00
Richard Antalik
2942147079 Fix: Incorrect operator name in VSE retiming menu
Oversight when retiming operators were merged with strip operators.
2024-01-09 19:00:38 +01:00
Sybren A. Stüvel
5b8207fa97 Anim: bone collection context menu, prevent operations on linked
Prevent operating on linked bone collections via the tree view context
menu.
2024-01-09 12:50:48 +01:00
Philipp Oeser
fb90654964 Fix #116011: Sorting Attributes by Name in UILists does not work
Whenever custom `filter_items` is used, everything regarding filtering
and sorting has to be implemented "by hand" here, this was just not done
for the sorting (which is now added).

Pull Request: https://projects.blender.org/blender/blender/pulls/116629
2024-01-09 09:26:06 +01:00
Campbell Barton
71af74622f Fix #115432: UV Follow Active Quads operator moves unselected vertices
Regression in [0] & [1]. Resolve by reverting most of [0],
restoring the original logic from 3.6.

The only significant changes kept are the use of selected UV faces
when called from the UV editor.

[0]: e0e3650495
[1]: 7b3e1cbb96
2024-01-09 16:49:52 +11:00
Alexander Gavrilov
d0ef66ddff Drivers: implement fallback values for RNA path based variables.
As discussed in #105407, it can be useful to support returning
a fallback value specified by the user instead of failing the driver
if a driver variable cannot resolve its RNA path. This especially
applies to context variables referencing custom properties, since
when the object with the driver is linked into another scene, the
custom property can easily not exist there.

This patch adds an optional fallback value setting to properties
based on RNA path (including ordinary Single Property variables
due to shared code and similarity). When enabled, RNA path lookup
failures (including invalid array index) cause the fallback value
to be used instead of marking the driver invalid.

A flag is added to track when this happens for UI use. It is
also exposed to python for lint type scripts.

When the fallback value is used, the input field containing
the property RNA path that failed to resolve is highlighted in red
(identically to the case without a fallback), and the driver
can be included in the With Errors filter of the Drivers editor.
However, the channel name is not underlined in red, because
the driver as a whole evaluates successfully.

Pull Request: https://projects.blender.org/blender/blender/pulls/110135
2024-01-08 15:24:59 +01:00
Sybren A. Stüvel
2274f2be4b Anim: fix Solo Bone Collection operator
Fix the 'Show All' bone collection operator, by making it operate on all
collections instead of just the roots. It also now ensures that all
ancestors of the solo'ed collection are shown (otherwise it's the only
visible one, but given that its parent is hidden, it's still not
visible).

This also fixes a related issue, where calling the operator without
passing the `name` parameter would do nothing. Now it soloes the active
bone collection.
2024-01-08 14:34:10 +01:00
Sybren A. Stüvel
ef5dd0e451 Anim: fix Show All Bone Collections operator
Fix the 'Show All' bone collections operator, by making it operate on all
collections instead of just the roots.
2024-01-08 14:34:10 +01:00
Bastien Montagne
d13edee3e0 UI/Code: Fix typos and other UI messages issues. 2024-01-08 12:03:35 +01:00
Campbell Barton
5dd91346e1 Cleanup: remove unused imports 2024-01-08 11:40:53 +11:00
Campbell Barton
0ba83fde1f Cleanup: spelling in comments 2024-01-08 11:24:37 +11:00
Hans Goudey
890f553318 Cleanup: Format 2024-01-04 15:41:58 -05:00
Matias Mendiola
b165b20cef GPv3: Move set uniform and set opacity operators to Stroke Menu
Due these two operators act on the stroke as a whole and to keep the menu ordering like GPv2

Pull Request: https://projects.blender.org/blender/blender/pulls/116764
2024-01-04 15:25:49 +01:00
Harley Acheson
29b1658124 UI: View As Render for Background Images
Add checkmark for "View as Render" to background
images in Properties / Camera data.

Pull Request: https://projects.blender.org/blender/blender/pulls/115120
2024-01-03 01:09:23 +01:00
Sybren A. Stüvel
65d25ed813 Anim: add bone_collection.bones_recursive property
Add a `bone_collection.bones_recursive` property that returns the set of
bones assigned to that bone collection or any of its child collections.

This property is implemented in Python, as that made it considerably
simpler to create the set semantics.
2024-01-02 16:55:55 +01:00
Harley Acheson
0251701cd6 Fix #116252: Corrections to Text Object Special Characters Menu
Small Corrections to the items on the Text / Special Characters menu.

Pull Request: https://projects.blender.org/blender/blender/pulls/116677
2023-12-31 19:18:47 +01:00
Habib Gahbiche
d0c53b58bc Cleanup: Make format
Pull Request: https://projects.blender.org/blender/blender/pulls/116643
2023-12-30 01:01:15 +01:00
Nate Rupsis
4ddb52a775 Anim: Action bake custom properties
Add custom properties to Action Bake.

objects will bake all animatable custom properties. Armatures will bake all bone custom properties,
as well as object (armature) custom properties.

Pull Request: https://projects.blender.org/blender/blender/pulls/113208
2023-12-29 17:59:24 +01:00
Clément Foucault
b7a7c2ac00 EEVEE-Next: Add lightweight deferred indirect lighting
This adds option to bypass the raytracing pipeline
entirely and use a cheaper evaluation option.

This reuse the same evaluation as the Blended materials.

This exhibits some artifacts on Apple hardware due to
synchronization issues.

Pull Request: https://projects.blender.org/blender/blender/pulls/116622
2023-12-29 08:34:19 +01:00
Sybren A. Stüvel
129fb2eab8 Anim: make bone collections hierarchical
Make it possible to nest bone collections. The data structure on the
armature is still a flat array. It is organised as follows:

- Sibling collections (i.e. ones with the same parent) are stored
  sequentially in the array.
- Each bone collection keep track of the number of children, and the
  index of the first child.
- Root collections (i.e. ones without parent) are stored as the first
  elements in the array.
- The number of root collections is stored on the Armature.

This commit also contains the following:

- Replaced the flat UIList of bone collections with a tree view.
- Updated the M/Shift+M operators (move/assign to collection) to work
  with hierarchical bone collections.
- Updated RNA interface to expose only root collections at
  `armature.collections`. All collections are available on
  `armature.collections.all`, and children at `bonecollection.children`.
- Library override support. Only new roots + their subtrees can be added
  via overrides.

See https://projects.blender.org/blender/blender/issues/115934

Co-authored with @nathanvegdahl and @nrupsis.

Pull Request: https://projects.blender.org/blender/blender/pulls/115945
2023-12-28 18:14:55 +01:00