Commit Graph

117289 Commits

Author SHA1 Message Date
nutti
313f3ecf98 PyDoc: correct CollectionProperty & PointerProperty type in Python docs
Ref: !132420
2025-01-06 20:29:29 +11:00
nutti
10e3e3b4a0 PyDoc: add bpy_prop_collection_idprop class document
Ref: !132587
2025-01-06 20:29:29 +11:00
Omar Emara
503e2c46a5 Fix: Compositor crash with group of different typed socket
The compositor crashes if a node inside a node group is connected to a
group input that have a different type and the node group is used
without a connection to that input. That's because the compositor code
assumes the type of the group input without implicit type conversion to
the expected type of the node. To fix this, handle implicit conversion
for unconnected sockets as well.
2025-01-06 11:14:27 +02:00
Omar Emara
b3623feab2 Compositor: Support node integer sockets
This patch adds support for using integer sockets in compositor nodes.
This involves updating the Result class, node tree compiler, implicit
conversion operation, multi-function procedure operation, shader
operation, and some operations that supports multiple types.

Shader operation internally treats integers as floats, doing conversion
to and from int when reading and writing. That's because the GPUMaterial
compiler doesn't support integers. This is also the same workaround used
by the shader system. Though the GPU module are eyeing adding support
for integers, so we will update the code once they do that.

Domain realization is not yet supported for integer types, but this is
an internal limitation so far, as we do not plan to add nodes that
outputs integers soon. We are not yet sure how realization should happen
with regards to interpolation and we do not have base functions to
sample integer images, that's why I decided to delay its implementation
when it is actually needed.

Pull Request: https://projects.blender.org/blender/blender/pulls/132599
2025-01-06 10:09:26 +01:00
Campbell Barton
5303e85b3f Fix #130744: Crash searching menus with Viewport Pie add-on
The logic to expand non menu-type menu buttons was calling panels
draw function without first checking the poll() function succeeded.
2025-01-06 15:44:10 +11:00
YimingWu
18b690dee6 Fix #132325: Decimate fails to convert small faces to quads
Decimate used `is_quad_convex_v3` to check if faces should be converted
to quads, adjust the epsilon since small faces were being skipped.

Ref: !132342
2025-01-06 13:46:41 +11:00
Campbell Barton
c27bf6bef8 Cleanup: CMake indentation 2025-01-06 12:48:51 +11:00
Harley Acheson
df57beb676 UI: Improved User Feedback for Animation Playback Timer
The "Blender" menu contains seven items in "System / "Redraw Timer"
that are for troubleshooting and testing.  Six of the items take far
less than a second, but one takes a long time. "Animation Play" times
how long it takes to play through your current animation ten times. But
there is no way to guess this and some users have run it accidentally
by finding it in menu search. It gives no feedback at all, and there
are no hints on how long it will take. Once it plays through your
animation once you might guess that it runs forever.  This PR shows
the test name and where it is in its ten runs. On platforms that
support it this also shows an app progress bar (on the taskbar icon for
Windows).

Pull Request: https://projects.blender.org/blender/blender/pulls/132648
2025-01-05 02:00:37 +01:00
Campbell Barton
5f640457d8 Cleanup: suppress various pylint warnings 2025-01-04 21:17:29 +11:00
Campbell Barton
6f64d70e60 Cleanup: use main(), declare __all__ for code generaltion scripts
- Using a main function allows the scripts to be imported without
  executing logic.
- Declaring `__all__` lets tools such as "vulture" detect unused code.
2025-01-04 20:06:15 +11:00
Campbell Barton
4c852d5566 Fix #131195: Crash with PyDrivers after canceling extensions update
Rendering a scene with py-drivers would crash after dropping an
extension onto Blender's window then canceling before the update
completed.

This was caused by context.temp_override pushing arguments into the
context but failing to pop them in the case of an error - which would
happen when the popup was closed while the update ran.
2025-01-04 19:09:54 +11:00
Campbell Barton
9363ad59b0 Fix #132615: Memory leak calling context.temp_override()
ContextTempOverride objects were not freeing the reference to their
arguments when the context managers __exit__ didn't run.

This would happen if __enter__ failed with an unsupported configuration
or if object was created and not used.

Resolve by making ContextTempOverride a container type with GC support.

This also allows the ContextTempOverride to be reused since it's
arguments are now cleared when it's deallocated instead of __exit__.
2025-01-04 19:09:53 +11:00
Campbell Barton
535b26d436 Cleanup: remove "__tp" from function names in bpy_rna_context
This convention seems strange and doesn't help with readability/clarity.
2025-01-04 16:32:04 +11:00
Campbell Barton
d2d754be3f Cleanup: spelling in comments (make check_spelling*)
- Back-tick quote math expressions so differentiate them
  from English.
- Use doxygen code blocks for TEX expressions.
2025-01-04 16:26:39 +11:00
Aaron Carlisle
1bcc01519a Cleanup: Spelling: "Explicitly" 2025-01-03 22:35:05 -05:00
Harley Acheson
9ed7b03e35 Fix #100652: Correct Shortcut Hovering Editor Type Button
When hovering over the "Editor Type" button it always shows Shift-F1 as
the shortcut no matter what the current Editor Type is. We already have
specific code for "SCREEN_OT_space_type_set_or_cycle" for the items on
the popup menu, but it doesn't handle the case of hovering the menu
itself. This adds just adds a line to handle this.

Pull Request: https://projects.blender.org/blender/blender/pulls/132612
2025-01-04 00:58:20 +01:00
Jesse Yurkovich
e5b3b9b9cb Cleanup: USD: various non-functional changes
- Pass large std::function by const ref
- Shift the mesh material assignment helpers inside main namespace
- Use MaterialFaceGroups type alias in more places
- Remove unused bmain argument from import_mesh_skel_bindings

Pull Request: https://projects.blender.org/blender/blender/pulls/132586
2025-01-03 20:36:07 +01:00
Damien Picard
e3f1a62a3f Geometry Nodes: rename Curve Spiral to Spiral in Add Node menu
Nodes should have the same name in the Add Node menu as their actual
name, but the Spiral node is called "Curve Spiral". Since there is no
ambiguity with another primitive node called Spiral, it can be renamed
to that.

This also fixes an issue with translation, where the node could not be
translated since its name was never extracted to the translation
files.

Pull Request: https://projects.blender.org/blender/blender/pulls/122289
2025-01-03 20:26:11 +01:00
Jacques Lucke
dc797e1210 Revert "Fix #132408: crash when outputting anonymous attribute from foreach zone"
This breaks some tests.

This reverts commit e948279818.
2025-01-03 19:55:15 +01:00
Hans Goudey
48cecef1e0 Cleanup: Use is_same_any_v wrapper
Pull Request: https://projects.blender.org/blender/blender/pulls/132567
2025-01-03 19:15:01 +01:00
Hans Goudey
3df7c6a428 Fix #132426: Crash loading old file with noise texture node
Some recently added versioning code incorrectly assumed that the
noise texture node would always have its storage struct allocated.
Just create the storage struct in versioning where necessary, to
avoid relying on defaults not changing in the future when the
struct is created as the node tree is initialized.

Pull Request: https://projects.blender.org/blender/blender/pulls/132555
2025-01-03 18:47:32 +01:00
Jacques Lucke
e948279818 Fix #132408: crash when outputting anonymous attribute from foreach zone
The issue was that the propagation of referenced anonymous attributes treated
geometry outputs of the foreach zone as "normal". That means that every
anonymous attributes referenced by the input socket would also be referenced by
the output socket.

However, just like in the repeat zone, this so called "propagate relation" needs
some special behavior, because anonymous attributes references created inside a
zone have to remain inside that zone. Instead, the output node creates a new
anonymous attribute reference that is used outside of the zone.

Pull Request: https://projects.blender.org/blender/blender/pulls/132560
2025-01-03 18:42:09 +01:00
Philipp Oeser
b79af08ade Fix #132548: keyframe_points.insert() misinterprets arguments
Symptoms were broken `keyframe_type` & `options` (e.g. falsely assuming
'NEEDED' option when this was not provided at all).

The parameter order was flipped (leading to false interpretations for
the enum (flag) values).

For historic reference: the `keyframe_type` was introduced in
570fbba3f3 (but in a way that would have broken the existing API),
that was tried to be corrected in 46aaa53998 (but that commit only
flipped the order in the parameter definitions, not in the actual
function `rna_FKeyframe_points_insert`).

So to resolve, correct the order in the function declaration.

Pull Request: https://projects.blender.org/blender/blender/pulls/132595
2025-01-03 17:42:07 +01:00
Philipp Oeser
8fa61bfdef Fix #132254: Symmetrized Limit Location Constraint wrong enabled min/max
We were already flipping the minima & maxima the right way, but the
checkboxes for which axis gets limited to a min/max were not updated. So
when a max X actually gets a min X, those checkboxes should be set
accordingly (now done).

Pull Request: https://projects.blender.org/blender/blender/pulls/132265
2025-01-03 17:41:31 +01:00
Christoph Lendenfeld
7636e6fca4 Fix #132182: Graph Editor slider increment having no visible effect
The issue was that the range for the time offset operator
was so large, that the 0.1 increment seemingly had no effect.
The solution is to add functionality to the slider to specify the increment step.
Since the time offset operator deals in frames it made sense to snap to whole numbers.

Also fixes #132187
For that the increment step has been chosen to allow for 10 steps in the slider range.

Pull Request: https://projects.blender.org/blender/blender/pulls/132554
2025-01-03 17:23:12 +01:00
Sean Kim
4c8fd7a17e Cleanup: Adjust some Sculpt undo multires comments
Pull Request: https://projects.blender.org/blender/blender/pulls/132600
2025-01-03 17:20:11 +01:00
Hans Goudey
c01b7ff9ad Fix: Mistaken node legacy enum change in recent refactor
Mistake in b43e2168e3.
2025-01-03 10:03:02 -05:00
Sybren A. Stüvel
266d1e8d2f Anim: do not draw constraint relationship lines for invalid targets
Only draw relationship lines between a constrained object/bone and its
target when there is actually a valid target. Previously Blender would
always draw a line, which would go to the world origin when the
constraint has no target. This was visually rather noisy and potentially
even misleading when there is actually an object at the origin.

Fixes #131477

Pull Request: https://projects.blender.org/blender/blender/pulls/132592
2025-01-03 15:51:40 +01:00
Sean Kim
c9ffd42417 Fix #132530: Undo after Apply Base doesn't correctly restore data
With the recent sculpt refactor project prior to 4.3, the Sculpt undo
system was changed such that an individual `SculptUndoStep` would store
a single type on the `StepData` struct instead of storing individual
nodes that each had their own type.

This works for most operators supported by Sculpt Mode, however, the
`Apply Base` multires operator was dependent on needing to store both
Geometry and Position data.

To restore old functionality, this commit removes the need for storing
this Position data by instead forcing the object space Sculpt Mode
multires data to be flushed to the tangent space MDisp data prior to
saving the current geometry state so that it can be restored correctly.

This has the following benefits:
* We can continue to assume that Geometry steps represent full-mesh
  changes and should require no further specialized processing.
* This better aligns with the future state of trying to flush this
  multires data on a per-stroke basis instead of needing to wait unti
  lthe user either quits or exits sculpt mode.

Pull Request: https://projects.blender.org/blender/blender/pulls/132569
2025-01-03 15:06:24 +01:00
Sybren A. Stüvel
61f8364dd1 Refactor: Anim, reduce cognitive complexity in ..._get_tarmat functions
Simplify the `${CONSTRAINT}_get_tarmat` functions, mostly by reducing
nesting via early returns.

Code like this:

```cpp
void blabla_get_tarmat(...) {
  if (VALID_CONS_TARGET(ct)) {
    // ... do useful stuff.
  }
  else if (ct) {
    unit_m4(ct->matrix);
  }
}
```

now looks like:

```cpp
void blabla_get_tarmat(...) {
  if (!VALID_CONS_TARGET(ct)) {
    unit_ct_matrix_nullsafe(ct);
    return;
  }

  // ... do useful stuff.
}
```

This is mostly done as preparation for an upcoming functional change.

No functional changes.

Pull Request: https://projects.blender.org/blender/blender/pulls/132591
2025-01-03 14:07:29 +01:00
Campbell Barton
33e38c605f Cleanup: correct indentation for CMake files, strip trailing space 2025-01-03 13:23:38 +11:00
Harley Acheson
72a9990779 Fix #92998: Allow UI List Reversed Alpha Sort
UI Lists has some buttons at the bottom related to sorting. One button
sorts in alphabetical order, the other reverses sort order. But when
both buttons are enabled you don't get reserved alpha. Contrary to what
the buttons show, enabling "reversed" turns off alpha sorting so you
just get a reversal of the natural order. This button fixes that so you
can reverse both natural and alpha sorted lists.

Pull Request: https://projects.blender.org/blender/blender/pulls/132578
2025-01-03 02:28:51 +01:00
Iliya Katueshenock
fa8574b80b Fix: Geometry Nodes: Triangulate Mesh node assertion case
Typo from ea875f6f32.
A range of triangles is pushed into the mask, but _last_ instead of _end_
was  used. This was found in #132333 report, but this PR does not fix a
reported issue.

Pull Request: https://projects.blender.org/blender/blender/pulls/132405
2025-01-03 01:42:39 +01:00
Charles Wardlaw
0c544974d1 USD: option to convert the scene's meters per unit value
This rescales the whole scene by its root transform to match the same
visual size while not forcing the user to wait for scale to be applied to
each object.

This is requested by studios whose main applications / USD scenes are
in CM, because referencing and payloading scenes from disparate scales
can cause issues at resolution time.

If "Apply Unit Scale Conversion" is unchecked on import, the user now
has the ability to bring the objects in with a scale factor of 1.0, so that the
objects may be edited as if Blender's scene units matches the imported
stage's.

At export time, a "Stage Meters Per Unit" value can be chosen from a list
of common measurements, as well as setting a custom value.

Co-authored-by: kiki <charles@skeletalstudios.com>
Co-authored-by: Michael Kowalski <makowalski@nvidia.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/122804
2025-01-02 22:04:58 +01:00
Hans Goudey
64087c70d5 Cleanup: Move some mesh normals functions to C++ API
Use C++ namespace, reference instead of pointer, and span instead
of raw pointers, mainly to make these functions easier to use in a
few more places.

Pull Request: https://projects.blender.org/blender/blender/pulls/132561
2025-01-02 20:32:47 +01:00
Ray Molenkamp
5783950ac5 Revert: 0dc484f9cc bf_rna modernisation
This caused build errors on the docs builder, I can't seem to reproduce
locally, so revert for now and have another look at some point in the
future.

Sadly as these changes usually go, this took 5c515e26bb and
2f0fc7fc9f with it as well.

Pull Request: https://projects.blender.org/blender/blender/pulls/132559
2025-01-02 19:56:24 +01:00
Sean Kim
37c3c70150 Fix #122078: Color Filter redo panel doesn't work occasionally
When a file is initially loaded or when the redo panel is used, the PBVH
may be null on an object. Because this filter requires the PBVH to check
the underlying mesh representation to prevent execution on Dyntopo &
Multires, we need to ensure that the PBVH is built.

This commit changes the `pbvh_get` call into a `pbvh_ensure` call and
moves some variable declarations around to avoid holding onto runtime
data that may get wiped out by requesting the evaluated depsgraph.

Pull Request: https://projects.blender.org/blender/blender/pulls/132048
2025-01-02 18:42:21 +01:00
Hans Goudey
3dab0b94eb Fix #131883: Animating particle system hair segment count causes crash
This property should not be animateable; there are fundamental limitations
in the design of the system that makes it disfunctional.

Pull Request: https://projects.blender.org/blender/blender/pulls/132557
2025-01-02 17:51:27 +01:00
Omar Emara
4ad1537ff7 Fix: Compositor: Conversion code might fall through
The recently added switch statements in conversion code might fall
through due to missing breaks. Fix that by adding needed breaks.
2025-01-02 17:43:09 +02:00
Christoph Lendenfeld
2d1fc1bcdd Fix #132195: Unable to key mesh attributes
The issue is that certain RNA paths cannot be generated to come
from an ID and `RNA_path_from_ID_to_property` will return no value.
We are using that function in the keyframing code to allow passing
in a pointer to a bone and a path relative to that bone.
Since there is currently no good way to find the path from the ID to an arbitrary
struct pointer (see #122427), this patch is a workaround that uses
the struct_pointer IF that happens to be an ID pointer.
Of course that still has the core limitation in place but until a
better solution is available on the RNA side this is the best we can do.

Pull Request: https://projects.blender.org/blender/blender/pulls/132552
2025-01-02 16:39:21 +01:00
Sean Kim
3c7041c11e Fix #132528: Mask by color crashes when used outside of mesh
Caused by a0e6e16da5

In cases where the cursor is not over the mesh, the operator needs to
check for and prevent further operation to avoid accessing incorrect
variant data.

In prior versions, while this operator did not crash, it would read
other custom layer data.

Pull Request: https://projects.blender.org/blender/blender/pulls/132538
2025-01-02 16:35:10 +01:00
Christoph Lendenfeld
c3e5d15c2e Anim: Make pose library code aware of slots
This patch makes the internal functions for the pose library aware of action slots.
* Allows to apply poses with more than 1 slot.
* The slot is chosen based on a best guess, with a fallback to the first slot.

Not in this patch:

There is no straightforward way to create multi slot pose assets yet. That will come later.
It is possible to manually tag an action with more than 1 slot as an asset though.

When applying poses, only the active object is modified. Multi object editing support will come later.

Part of Design #131840

Pull Request: https://projects.blender.org/blender/blender/pulls/132161
2025-01-02 15:27:06 +01:00
Aras Pranckevicius
4546367bb3 Cleanup: Add ibuf channel expectation asserts in VSE code
Whole of VSE assumes that all images are always 4 channels. Add
asserts in several places to more clearly indicate that.

Pull Request: https://projects.blender.org/blender/blender/pulls/132546
2025-01-02 14:33:52 +01:00
Omar Emara
0ec7edf411 Cleanup: Compositor: Omit default case for ResultType
Explicitly list all result types to make it easier to add new result
types.
2025-01-02 14:42:44 +02:00
Omar Emara
b6be52c2b2 Refactor: Compositor: Reduplicate type conversion code 2025-01-02 14:02:13 +02:00
Brecht Van Lommel
841ae6e8ab Fix part of #131933: Crash with playback of deforming subdivision surface
The `ForeachContext` in `deform_coarse_vertices` does not use TLS but still has
a `func_free` callback set. Change the task API to allow this.

Pull Request: https://projects.blender.org/blender/blender/pulls/132498
2025-01-02 12:21:56 +01:00
Omar Emara
159038ce7c Cleanup: Compositor: Deduplicate single value setters 2025-01-02 10:20:17 +02:00
Campbell Barton
f00661614f Cleanup: remove vector CLAMP macros
This can be done using functions to avoid multiple argument
instantiations.
2025-01-02 15:11:23 +11:00
Campbell Barton
f417c7ad2c Cleanup: sort cmake file lists 2025-01-02 15:11:21 +11:00
Campbell Barton
dca0996777 Cleanup: various non-functional changes for C++ 2025-01-02 15:11:20 +11:00