Commit Graph

106578 Commits

Author SHA1 Message Date
Lukas Tönne
dfec8171cc Modifiers: Increase the length of name strings in ModifierTypeInfo
These name fields run out of space for some of the new Grease Pencil
modifiers, like "GreasePencilEnvelopeModifierData". Only one of these
strings is stored for each modifier type, so this should have almost no
impact on size.

Pull Request: https://projects.blender.org/blender/blender/pulls/117980
2024-02-08 12:34:27 +01:00
Lukas Tönne
92cadc24b1 Cleanup: Use generic RNA_MOD_OBJECT_SET for GP3 modifier RNA setters. 2024-02-08 11:55:43 +01:00
Lukas Tönne
73d4b148a3 Cleanup: fix formatting. 2024-02-08 11:40:56 +01:00
Clément Foucault
763b3b3b12 EEVEE-Next: Change light_attenuation_facing
Take light shape into consideration and do a small
fade to avoid abrupt lighting changes.
This fixes quite a lot of light leak but doesn't
fix all of them since light can still leak
during the fade. We could do this fade on the
lit side but then it break the working cases.
This does however fix the appearant sharp shadowing
that was visible on big light source.

Co-authored-by: Weizhen Huang <weizhen@blender.org>
2024-02-08 11:36:22 +01:00
Philipp Oeser
cb514b9e9d Merge branch 'blender-v4.1-release' 2024-02-08 10:02:15 +01:00
Philipp Oeser
228ee8f1c3 Fix #96458: Add channel processing for UsdUVTexture
This adds the processing required to import and export simple material graphs utilizing the UsdUVTexture outputs channels.

If only r, g or b are specified as output, we hook up a `Separate Color` node and connect the appropriate channel from there.
(if a is specified as output, the Alpha output of an image texture node was used already)

On the export side, we traverse from the socket to the image texture node, and if a `Separate Color` on the way, we are using the channel from there to put on the output.

https://openusd.org/release/spec_usdpreviewsurface.html#texture-reader

Pull Request: https://projects.blender.org/blender/blender/pulls/117901
2024-02-08 10:01:41 +01:00
Campbell Barton
000bed915d Cleanup: replace magic numbers with event value, improve function name
Use a more concise name for event type conversion.
2024-02-08 16:57:36 +11:00
Campbell Barton
b28e6751f9 Merge branch 'blender-v4.1-release' 2024-02-08 16:27:51 +11:00
Campbell Barton
debf0b52c2 Merge branch 'blender-v4.1-release' 2024-02-08 16:27:45 +11:00
Campbell Barton
f9e976c899 Fix error suppressing double-click events for modal keymap handling 2024-02-08 16:25:01 +11:00
Hans Goudey
cf5304855f Fix #117632: IME input crash after refactor to use std::string
The IME widget drawing code replaces the button's draw string, but it
did this with a C-style const cast which let this go unnoticed in
089c389b5c which changed the string from a C array to a
C++ std::string, where it's UB to just change the length this way.

To fix the crash, just store the string in a temporary array so we
can use the existing unchanged formatting code.

Pull Request: https://projects.blender.org/blender/blender/pulls/117968
2024-02-08 05:52:19 +01:00
Campbell Barton
aead8a0428 Merge branch 'blender-v4.1-release' 2024-02-08 15:08:27 +11:00
Campbell Barton
899f5e2c94 Fix incorrect use of EVENT_* types as a flag
Also use ISKEYMODIFIER macro.
2024-02-08 15:07:40 +11:00
Julian Eisel
8f553391e5 Fix division by 0 in tree view drawing
Would happen when there is no View2D data, like in popups.
2024-02-08 00:03:34 +01:00
Harley Acheson
b503a37808 Merge branch 'blender-v4.1-release' 2024-02-07 12:20:48 -08:00
Harley Acheson
b6091f134c Fix #117956: Revert Last Chance Placeholder Default
As #117956 shows, guessing default placeholder text based on the
property UI name can have bad consequence. Best to leave this out and
just set custom placeholder when needed.

Pull Request: https://projects.blender.org/blender/blender/pulls/117962
2024-02-07 21:19:28 +01:00
Brecht Van Lommel
680b9a9c35 Merge branch 'blender-v4.1-release' into main 2024-02-07 19:32:39 +01:00
Hans Goudey
2a2eeb8195 Fix: Operator popup crash with default arguments
Caused by a227f08343.
Thanks to Guillermo Venegas for reporting.
2024-02-07 13:12:52 -05:00
Brecht Van Lommel
bd8a44e169 Lights: Option to use old point light falloff
Add new "Soft Falloff" option on point and spot light that uses
the old light behavior from Blender versions before 4.0. Blend
files saved with those older versions will use the option.

This option is enabled by default on new lights.

Fix #114241

Co-authored-by: Weizhen Huang <weizhen@blender.org>
Co-authored-by: Clément Foucault <foucault.clem@gmail.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/117832
2024-02-07 19:07:11 +01:00
Bastien Montagne
43726134c3 BKE_idtype: Add access to IDTypeInfo from idtype index. 2024-02-07 19:07:06 +01:00
Bastien Montagne
55cb73a938 Cleanup: Minor improvement to comment in DNA_ID.h 2024-02-07 19:07:06 +01:00
Hans Goudey
b19bd19660 Cleanup: Make format 2024-02-07 11:45:59 -05:00
Falk David
bd22059752 GPv3: Add initial weight paint mode support
This makes it possible to enter and exit weight paint mode in Grease Pencil 3.
No other functionality is added for now.

Pull Request: https://projects.blender.org/blender/blender/pulls/117945
2024-02-07 17:19:43 +01:00
Hans Goudey
b88e40d1df Fix: Stack use after return in RNA preprocessing after recent commit
Issue with dddc69d0be
2024-02-07 11:08:17 -05:00
Hans Goudey
10a258b564 Cleanup: Remove unnecessary .c_str() calls 2024-02-07 10:53:28 -05:00
Hans Goudey
a227f08343 Cleanup: Use std::string for operator props popup arguments
The title and confirmation text are stored in a string anyway,
we might as well use that type for the arguments.
2024-02-07 10:28:45 -05:00
Falk David
0a45acbe3b GPv3: Layer Parenting/Transforms
This implements layer parenting and layer transforms.

* Adds a new "Transform" panel in the object-data properties with the (local) translation, rotation and scale.
* Adds a new "Relations" panel with the parent property (and also bone name in case the parent is an armature).
* When converting from GPv2 to GPv3, the parent and transforms are converted too.
* Bone names are updated if they are renamed in the armature.

Implementation details:
* The positions in the drawings are always in layer space. During extraction, we transform the positions to object space. Note that this could be optimized further and done in the render engine itself.
* This means that e.g. the selection code (which needs to know where the positions are on screen) now takes this transform into account.
* The layer transform is calculated when accessed (from the location, rotation, scale properties).
* Code that needs to know where the positions are on screen now takes this new transform into account.

Pull Request: https://projects.blender.org/blender/blender/pulls/117247
2024-02-07 16:28:14 +01:00
Hans Goudey
1f55365ed1 Merge branch 'blender-v4.1-release' 2024-02-07 10:22:38 -05:00
Hans Goudey
5efb35100d Fix #117929: Extract face set operator crash
The problem was calling a "for eval" function on an original mesh
in the main data-base. The parameters are already copied anyway,
so the call was unnecessary. Also reorder some changes to happen
before the geometry is moved to the original mesh.
2024-02-07 10:21:02 -05:00
Hans Goudey
631a44afc3 Fix #117929: Extract face set operator crash
The problem was calling a "for eval" function on an original mesh
in the main data-base. The parameters are already copied anyway,
so the call was unnecessary. Also reorder some changes to happen
before the geometry is moved to the original mesh.
2024-02-07 10:19:59 -05:00
Hans Goudey
6702f74d0b Curves: Improve copy and move assignment
Previously the default constructor ran, then the copy or move
assignment. This resulted in extra creations of runtime data,
including allocations of all the shared caches, only for them
to be immediately replaced by the new ones. Move assignment also
didn't clear the source curves completely, which could result in
higher memory usage or worse, extra users for attribute arrays,
which could lead to unnecessary copying.

In a very simple test repeatedly copying a tiny Curves data-block,
I observed a 30% performance improvement.

This also fixes a memory leak of the offsets in the copy assignment.

Pull Request: https://projects.blender.org/blender/blender/pulls/117932
2024-02-07 15:40:29 +01:00
Falk David
84b9fe3dbe Cleanup: Curves Selection: Rename coords argument to lasso_coords 2024-02-07 15:12:17 +01:00
Hans Goudey
fbf47b9a12 Refactor: Use std::string for keymap string return values
The main simplification is using return values rather than return
arguments, and the additional semantic clarity from std::optional.
Also use `fmt` for formatting and use lambdas instead of macros
as helpers in a few modal keymap formatting functions.

Similar commits:
- a1792e98a4
- f04bc75f8c
- 6abf43cef5
- 7ca4dcac5a

Pull Request: https://projects.blender.org/blender/blender/pulls/117785
2024-02-07 14:22:54 +01:00
Jacques Lucke
fc8333089c Fix: duplicate modifier uids with overrides
Keep the `persistent_uid` that is already known to be unique on `ob_dst`
instead of copying the one from `md_src` which may not be unique in
`ob_dst`.

Pull Request: https://projects.blender.org/blender/blender/pulls/117942
2024-02-07 14:21:38 +01:00
Hans Goudey
e690210e4f Merge branch 'blender-v4.1-release' 2024-02-07 08:19:18 -05:00
Hans Goudey
78963b466b Mesh: Add "Set Sharpness by Angle" operator
This simple  operator set the edge sharpness attribute on edges,
either extending the existing values or replacing them completely.
It's meant to make it more convenient to manually control the
sharpness now that there can be more reason to do that after
auto smooth became a modifier.

Pull Request: https://projects.blender.org/blender/blender/pulls/117918
2024-02-07 14:17:16 +01:00
Falk David
b3418f688c Refactor: Use new math API for ED_view3d_ob_project_mat_get_from_obmat
No functional changes.

Pull Request: https://projects.blender.org/blender/blender/pulls/117938
2024-02-07 14:04:26 +01:00
Thomas Dinges
fb0f06a2ac Revert "Release cycle: 4.1, Bcon3"
This reverts commit 4db1426818.
2024-02-07 12:53:08 +01:00
Thomas Dinges
fc98c896ef Merge branch 'blender-v4.1-release' 2024-02-07 12:52:25 +01:00
Thomas Dinges
4db1426818 Release cycle: 4.1, Bcon3 2024-02-07 12:49:52 +01:00
Thomas Dinges
f77996e344 Release cycle: Start of 4.2, Bcon1 2024-02-07 12:46:54 +01:00
Sergey Sharybin
45a73827b0 Fix missing dependency in CMake file
Make sure bf_rna is compiled prior to bf_editor_space_userpref,
so that the RNA_prototypes.h can be included.

Solves possible compilation error when building Blender from
scratch.

Pull Request: https://projects.blender.org/blender/blender/pulls/117937
2024-02-07 11:39:45 +01:00
Damien Picard
019eb5a35e I18n: use IFACE_ to translate status bar info & viewport statistics
Although the information displayed in the status bar is strictly
speaking reports, it makes sense to translate them using the Interface
setting instead of Reports, as the tool names and stats terms are
also translated in other UI places (toolbar, menus).

This change includes status bars statistics and keymaps, and viewport
statistics.

The change is quite extensive as it is all or nothing. Translating
keymaps using Interface means some status messages will include them
indirectly, and thus cannot use Reports without having a weird mix of
original and translated words. In turn, having only some messages
translated would be even more confusing.
The result is that all messages related to input are now translated with
Interface, which I think also makes sense.

Discussed as a followup to !116804.

-----

cc. @gtitaev

Pull Request: https://projects.blender.org/blender/blender/pulls/117234
2024-02-07 11:17:50 +01:00
Philipp Oeser
b56192b3bb Fix: Simplify "Volume Resolution" not updating for non volume objects
This came up in #117747.

Unless an object was of OB_VOLUME type, the setting was not updating the
viewport accordingly since the introduction in 365bf103d1. So if for
example a mesh has a "Mesh to Volume" node, the update did not take
place.

If we use context, we can check the evaluated GeometrySet on any object
type with a geometry nodes modifier though and if it has a volume, we
can also tag for update.

Pull Request: https://projects.blender.org/blender/blender/pulls/117848
2024-02-07 10:32:06 +01:00
Bastien Montagne
7ca62fa54e Refactor: Turn main USD public header into full Cpp one.
Rename `usd.h` to `usd.hh`, and put its declarations in the
`blender::io::usd` namespace.

Pull Request: https://projects.blender.org/blender/blender/pulls/117897
2024-02-07 09:42:23 +01:00
Bastien Montagne
9363293472 Refactor: USD: Rename usd.hh to usd_private.hh
This header is for 'internal' USD code only (also needed by the hydra
code), and uses references to the USD library itself, so its previous
name was a bit too generic.

First step to move the main public Blender USD API header (`usd.h`) to cpp.
2024-02-07 09:42:20 +01:00
Pratik Borhade
af27c1feed Fix #113365: Backdrop lines don't match height in nla
Adjust ymax of action in frame range so that height will match with the
channel's height. Use same ymax as in `acf_nlaaction_backdrop`.
Also fixed `ycenter` value.

Pull Request: https://projects.blender.org/blender/blender/pulls/113490
2024-02-07 08:12:13 +01:00
Hans Goudey
c743213c3b Cleanup: Add missing forward declaration 2024-02-06 21:32:26 -05:00
Guillermo Venegas
c00c3c9eac UI: Import dialog popup feedback
For import operators dialog popups shows the name
of the file that is being imported as title, in case of
multiple file import shows the count.

Pull Request: https://projects.blender.org/blender/blender/pulls/117917
2024-02-07 01:00:15 +01:00
Christoph Lendenfeld
446b92d2ce Anim: Graph Editor - automatically lock key translation to a single axis
When moving keys in the Graph Editor animators
usually only want to move them on one axis.
While this is possible in a few ways (G+X, or G + Middle Mouse Button click),
we could default the behavior to always lock on an axis.
This was suggested by Dreamworks animators during the
Animation & Rigging module meeting.
https://devtalk.blender.org/t/2024-01-26-animation-rigging-module-meeting/33081#patch-review-decision-time-5

This PR adds an option with which the movement is
always locked to a single axis by default.
The option can be found in the Graph Editor under "View->Auto-Lock Axis".

The movement will then be restricted to the axis along
which you've moved the cursor the most.
You can still manually override the lock behavior by pressing `X` or `Y`.

I am piggybacking off the auto locking feature you get when pressing the middle mouse button.
When the new feature is enabled I call that at the start of the transformation.
Except when:
* only handles are selected
* the tweak mode has been started on a handle

This is to not snap handles, which is a behavior that has
been requested by the artists.

Pull Request: https://projects.blender.org/blender/blender/pulls/117669
2024-02-06 23:31:09 +01:00