Commit Graph

120055 Commits

Author SHA1 Message Date
Hans Goudey
01941e2b50 Geometry Nodes: Use boolean type for "use attribute" inputs
When the "use_attribute" properties were added, boolean IDProperties
didn't exist. Then we didn't change it for a while because of forward
compatibility concerns. But currently we always convert boolean
properties to integer properties when saving anyway (since
2ea47e0def, so there is no issue with compatibility.
Using booleans makes working with the properties in the Python API
a bit friendlier.

Pull Request: https://projects.blender.org/blender/blender/pulls/119129
2024-03-08 17:49:09 +01:00
Germano Cavalcante
930b11b0fe Fix: Edge Slide sometimes slides edge in wrong direction
Caused by 7f1b70ac50.

The test to find the best direction did not work for boundary edges.
2024-03-08 12:53:41 -03:00
Hans Goudey
456c34da1a Cleanup: Use higher level APIs for "set attribute" geometry nodes
Similar changes to a2726a3d7f
Also tweak variable names and the access of geometry set grease pencil data.
2024-03-08 10:50:42 -05:00
Germano Cavalcante
d1bcc0306e Cleanup: use more descriptive names for variables
And follow convection for comments.
2024-03-08 12:09:03 -03:00
Germano Cavalcante
1ce73b6bce Cleanup: use 'r_' prefix for output parameters, order last
Also use const arguments.
2024-03-08 12:07:32 -03:00
Hans Goudey
1050d6147f Cleanup: Remove unnecessary C wrappers for UI view classes 2024-03-08 09:16:07 -05:00
Christoph Lendenfeld
e07e983fc1 Fix: Memory leak when inserting keyframes with NLA offset
Introduced with #118957

When calling `BKE_animsys_get_nla_keyframing_context`
the function allocates memory, which needs to be freed later.
This was missed.

Pull Request: https://projects.blender.org/blender/blender/pulls/119208
2024-03-08 14:42:35 +01:00
megakite
8f120749dd Fix #119021: Crash when adding GP object
Added a null check for RE_GetRenderLayer() which could possibly return
null and then stored in `render_layer`, in order to prevent members of
`render_layer` being accessed in RE_pass_find_by_name(), and thus solved
the segmentation fault.

Pull Request: https://projects.blender.org/blender/blender/pulls/119200
2024-03-08 14:28:05 +01:00
YimingWu
6ed4282771 GPencil: Remove subdiv modifier unused vgroup UI
The UI was erroneously added initially for the stroke filter, now
removed.
2024-03-08 20:19:46 +08:00
Pratik Borhade
7e3abdf503 Merge branch 'blender-v4.1-release' 2024-03-08 16:56:20 +05:30
Pratik Borhade
2191cbf7f5 Fix #119106: Set Action in outliner does not update the animation
This is due to the missing depsgraph update

Pull Request: https://projects.blender.org/blender/blender/pulls/119112
2024-03-08 12:24:03 +01:00
Pratik Borhade
021565d867 Fix #119142: Skip linking collection inside another linked collection
When linking a collection from library, it can be linked inside another
linked/overrided collection if it is selected in outliner. This can be
prevented by linking with editable parent collection.

Pull Request: https://projects.blender.org/blender/blender/pulls/119144
2024-03-08 12:23:19 +01:00
Campbell Barton
eabff7334d Merge branch 'blender-v4.1-release' 2024-03-08 20:58:33 +11:00
Campbell Barton
738c1b6ca9 Docs: correct typo & terms in --help text 2024-03-08 20:57:56 +11:00
Omar Emara
f25983f69b Merge branch 'blender-v4.1-release' 2024-03-08 11:57:37 +02:00
Omar Emara
8cf8b54332 Fix: Viewport Compositor depth has low precision
The depth pass of the Viewport Compositor has low precision if the
precision of the node tree is set to Auto. To fix this, we always
expose the depth pass in full precision.
2024-03-08 11:55:23 +02:00
Christoph Lendenfeld
57419c9653 Refactor: keyframing functions return more detailed status
The keyframing functions up to this point created many
messages through the `ReportList` about what went wrong
when inserting keys.

This has 2 issues:
* Everyone that wants to insert keyframes needs to have
a `ReportList` which comes from `bContext`
* The keyframing functions are very verbose.
Providing the user with errors when there is actually nothing wrong.

To combat that, return a status enum from functions that deal
with a single FCurve.
Functions that deal with more than one FCurve collect those statuses
into a new class `CombinedKeyingResult`
Based on that we can create a single well worded error message,
instead of potentially flooding the user with individual messages.

The downside is that some info is lost, e.g. we do not
know which exact FCurve has failed.

This will show a formatted error when inserting keys with a keying
set or when pressing `I` over the property to keyframe.
But not when pressing `I` in the viewport. The latter can be fixed in a later patch.

Pull Request: https://projects.blender.org/blender/blender/pulls/117449
2024-03-08 09:56:40 +01:00
Omar Emara
a444a5eeba Fix: Byte interpolation with clamped boundary returns zero
The byte BLI image interpolation function with clamped boundary returns
zero for out of bound pixels. This is the same as #119164, but for byte
interpolation.

Pull Request: https://projects.blender.org/blender/blender/pulls/119173
2024-03-08 07:50:01 +01:00
Campbell Barton
f3e0e39df5 Cleanup: use const pointers where camera data isn't modified 2024-03-08 17:15:08 +11:00
Campbell Barton
8cbb57ee0a CLI: suppress noisy prints when running commands
Messages such as "Blender quit" get in the way of custom commands,
add G.quiet to suppress noisy "info" prints.
2024-03-08 13:27:29 +11:00
Campbell Barton
75b6dbd132 WM: move prints for loading startup & preferences to logging
Now messages for loading the preferences are logged instead of printed,
with additional logging for the startup file.
Access with the argument --log "wm.files"

Custom command-line actions would print that the preferences were
loading which distracts from the commands output.

Regular blend files loading still prints a message.
2024-03-08 13:27:27 +11:00
Campbell Barton
20b5908af8 Docs: reference G & U from Global & UserDef doc-strings
Include some context for how these structs are used as it's not so
clear where values are set/initialized.
2024-03-08 13:26:07 +11:00
Campbell Barton
8dd049d569 Cleanup: clarify argument names for passing a file buffer
Prefer the term size over length for size in bytes.
2024-03-08 12:57:34 +11:00
Campbell Barton
ba3c9e1661 Cleanup: de-duplicate logic for setting background mode 2024-03-08 12:57:34 +11:00
Jesse Yurkovich
e07081e15b USD: Fix cyclic bezier curve export
During work on GeometrySet import it was discovered that periodic
(cyclic) bezier curves do not need their first control point repeated
in the actual scene description.

The USD API documentation was a bit unclear on this aspect but this has
been confirmed informally on the AOUSD forum and emperically using
another implementation.

This patch removes the duplicated start point during export.

Pull Request: https://projects.blender.org/blender/blender/pulls/119185
2024-03-08 02:18:15 +01:00
Campbell Barton
6f6a6ace39 Cleanup: redundant forward declarations of structs 2024-03-08 11:31:11 +11:00
Campbell Barton
cb4351665a Cleanup: format, trailing space 2024-03-08 11:31:01 +11:00
Campbell Barton
9372e0dfe0 CLI: support defining custom commands via C++ & Python API
Add support for add-ons to define commands using the new argument
`-c` or `--command`.

Commands behave as follows:

- Passing in a command enables background mode without the need to pass
  in `--background`.
- All arguments following the command are passed to the command
  (without the need to use the `--` argument).
- Add-ons can define their own commands via
  `bpy.utils.register_cli_command` (see examples in API docs).
- Passing in `--command help` lists all available commands.

Ref !119115
2024-03-08 11:10:13 +11:00
Campbell Barton
9dd3f74c85 UI: minor tweaks to full-stop in messages
Use a full-stop after the quoted button name, also wrap strings
in a more readable way.
2024-03-08 10:26:51 +11:00
Hans Goudey
744f3b2823 Cleanup: Grammar in comments: Fix uses of "own"
"Own" (the adjective) cannot be used on its own. It should be combined
with something like "its own", "our own",  "her own", or "the object's own".
It also isn't used separately to mean something like "separate".

Also, "its own" is correct instead of "it's own" which is a misues of the verb.
2024-03-07 16:23:35 -05:00
Hans Goudey
8b014b34aa Cleanup: Move some asset browser code to proper namespace
Also remove an unnecessary C wrapper of a C++ class.
2024-03-07 16:23:35 -05:00
Hans Goudey
d8252cdff7 Cleanup: Use "this->" to call class methods 2024-03-07 16:23:35 -05:00
Harley Acheson
7e8baea394 Revert #119181: Popover Button Padding for Arrow
Reverting aa328e898e as this causes unintended changes elsewhere. Even
if made more conservative with just allowing UI_LAYOUT_PANEL and
force_menu.  Will need further investigation for a better solution.

Pull Request: https://projects.blender.org/blender/blender/pulls/119187
2024-03-07 22:22:31 +01:00
Harley Acheson
aa328e898e UI: Popover Button Padding for Arrow
Currently UI_BTYPE_POPOVER with icon and without text will get enough
extra padding to fit a downward arrow, only if in a header region. This
PR allows it to get the same padding in other areas when "force_menu"
is true.

Pull Request: https://projects.blender.org/blender/blender/pulls/119181
2024-03-07 22:01:56 +01:00
Brecht Van Lommel
daf3512a51 Merge branch 'blender-v4.1-release' 2024-03-07 20:16:51 +01:00
Hans Goudey
4e196f916c Cleanup: Remove unnecessary AssetListStorage class
This class was just used to hold some functions which can just as well
be declared static outside of any class. It was never even instantiated.
Removing the class removes some indirection in this file that made
the code less readability, and avoids misleading readers.

Pull Request: https://projects.blender.org/blender/blender/pulls/119137
2024-03-07 18:56:24 +01:00
Habib Gahbiche
ab3b8df693 Fix #116249: Compositor: Gizmos ignore backdrop transformations
Consider offset caused by transform and translate nodes in backdrop.

Affected nodes are:
- Corner Pin
- Sun Beams.

The behavior is now slightly different for rotated images (using a transform or rotate node) compared to Tiled compositor: the gizmos might move when image is rotated. The reason is the Full Frame compositor changes the image dimensions after rotation

Pull Request: https://projects.blender.org/blender/blender/pulls/119025
2024-03-07 18:47:28 +01:00
Bastien Montagne
d99fffc460 GPv3: Legacy Conversion: Animation: Optimize fcurves handling.
Did not realize it, but original commit was re-generating some 'static'
strings (at modifier level) for each and every processed FCurves!

Now create these base RNA paths only once per modifier, outside of the
lambda callback.
2024-03-07 17:39:40 +01:00
Christoph Lendenfeld
4d958ca19a Fix: View in Graph Editor not working when object is unselected
The new operator "View in Graph Editor" (#114407) only looked at the selection
when generating the FCurve bounds.

This failed in certain cases if things are not selected, or not selectable.
The simplest example is to key the emission strength of the world settings and
try to view that.
This was mentioned by Jonathan Lampel on the PR #114407

The fix is to also resolve the bounds of the animation data on the button.
This means for a few FCurves the bounds might be calculated twice but it
doesn't change the overall result.

This has another side effect though:
The Graph Editor might zoom into an area where there is no FCurve
visible because the thing is not selected so it isn't shown.
This issue existed before if filters were applied, but is now more pronounced
since by default the Graph Editor doesn't show unselected objects.

A warning is raised when at least one of the FCurves that are viewed is not
visible with the current filter settings. The view will still zoom into that area.

Pull Request: https://projects.blender.org/blender/blender/pulls/118658
2024-03-07 17:15:02 +01:00
Sybren A. Stüvel
90ef46baa1 Anim: DNA for Animation data-block
Introduce new DNA for the `Animation` data-block and its sub-data.

This includes the blenkernel code for reading & writing to blend files,
and for memory management (freeing, duplicating). Minimal C++ wrappers
are included, with just the functionality needed for blenkernel to do
its job.

The Outliner code is extended so that it knows about the new data-type,
nothing more.

For more info, see issue #113594.

Pull Request: https://projects.blender.org/blender/blender/pulls/119077
2024-03-07 16:41:25 +01:00
Omar Emara
559ad5e0f9 Compositor: Add utility for sampling buffer at normalized coordinates
This patch adds a new utility method to the MemoryBuffer class to sample
the buffer at normalized coordinates.
2024-03-07 16:56:02 +02:00
Philipp Oeser
77168d960a Merge branch 'blender-v4.1-release' 2024-03-07 15:46:04 +01:00
Sybren A. Stüvel
35a5518379 Cleanup: Sculpting, fix compiler warning
Fix 'unused variable' warning in release-mode builds. The variable is
only used in a `BLI_assert`.

I've assumed that the call to `BKE_sculpt_object_pbvh_ensure()` is still
important, and not just there for the assertion.

No functional changes.

Pull Request: https://projects.blender.org/blender/blender/pulls/119158
2024-03-07 15:43:55 +01:00
Philipp Oeser
5d1d447c2b Fix #114552: Copy material to selected crash on object lacking slot
Caused by 9c1da81a4c.

This happened in the case where objects shared the same data and slots
are assigned to object and receiving object did not have a material slot
yet.

Then, `ob->matbits` may be NULL, now just check for this, too.

Pull Request: https://projects.blender.org/blender/blender/pulls/119161
2024-03-07 15:43:47 +01:00
Omar Emara
5ab0cc8e74 Fix: Interpolation with clamped boundary returns zero
The BLI image interpolation function with clamped boundary returns zero
for out of bound pixels. That's because the neighbour pixel wrapping
condition disregarded the border template argument. To fix this, only
handle that condition if in border mode.

Pull Request: https://projects.blender.org/blender/blender/pulls/119164
2024-03-07 15:34:42 +01:00
Hans Goudey
c8efea42e1 Cleanup: Remove unnecessary braces for container default constructors
These containers (Set, Vector, Map, Span), etc. have default constructors,
making the braces unnecessary for default initialization. Better to depend
on that consistently rather than having braces in some places and not others.
2024-03-07 09:30:23 -05:00
Hans Goudey
d727738157 Cleanup: Comment formatting
Use consistent formatting for multi-line comments.
2024-03-07 09:30:22 -05:00
Hans Goudey
c25a635587 Core: Avoid double map lookup in ID remapping
Theoretically this could improve performance when remapping
many IDs, but the goal is more to have consistent best practices
in the use of `Map`.
2024-03-07 09:30:22 -05:00
Hans Goudey
72758f3296 Cleanup: Use FunctionRef for IDRemapper callback
This avoids the need for a separate argument struct in a few cases
and generally makes the remapping friendlier to use with lambdas.
2024-03-07 09:30:22 -05:00
Hans Goudey
2f0fa33eec Cleanup: Remove unnecessary void keyword in C++ function declarations 2024-03-07 09:30:22 -05:00