Commit Graph

134824 Commits

Author SHA1 Message Date
Brecht Van Lommel bef3a7b978 Fix: Operator properties don't undo when owner is collection
For collection export, we need operator properties to not assume they
are owned by the window manager.

Pull Request: https://projects.blender.org/blender/blender/pulls/118855
2024-03-29 14:49:04 +01:00
Falk David f3505f12d2 GPv3: Add brush falloff panel to tint tool
This was talked about in
https://projects.blender.org/blender/blender/pulls/119323.
Adds back the panel so that the falloff can be changed again.
2024-03-29 14:41:35 +01:00
YimingWu 127f879be9 GPv3: Tint tool
This implements the tint tool from GPv2.

Pull Request: https://projects.blender.org/blender/blender/pulls/119323
2024-03-29 12:43:15 +01:00
Falk David 5ce54fbd25 Fix: GPv3: Use const reference to avoid copy
This was resulting in a copy of the layer, which shouldn't
be done.
2024-03-29 12:02:00 +01:00
Sergey Sharybin adaa55cecc Cleanup: Code formatting
Pull Request: https://projects.blender.org/blender/blender/pulls/120055
2024-03-29 11:58:14 +01:00
Sergey Sharybin d174959759 Fix #120051: Crash when using shrinkwrap with Target Normal Project
The issue was introduced by b35831ad6c.

Since that commit `tree->boundary` will always be non-nullptr, even
when the target mesh had no boundaries. Some code was still relying
on the fact that `tree->boundary != nullptr` means the mesh has
boundary.

Update shrinkwrap code for this fact, avoiding access past array
boundaries.

Pull Request: https://projects.blender.org/blender/blender/pulls/120054
2024-03-29 11:43:15 +01:00
casey bianco-davis 7669ba7a5c GPv3: Handle UVs in Smooth Modifier
The smooth modifier was made before UVs were implemented.
This adds smoothing to the UV rotations.

Pull Request: https://projects.blender.org/blender/blender/pulls/120032
2024-03-29 11:18:06 +01:00
Campbell Barton 4365d0496a Cleanup: use a const pointer for unit-settings 2024-03-29 16:37:36 +11:00
Campbell Barton e04aa7c188 Cleanup: remove unit scale initialization in UI logic
Versioning logic was added since 2.5x
2024-03-29 16:30:08 +11:00
Campbell Barton 0eb1317e70 Cleanup: remove unused exception value 2024-03-29 16:18:28 +11:00
Campbell Barton 3d2593b229 Cleanup: replace "derived mesh" with "evaluated mesh" in code comments
References to the evaluated mesh were referring to "derived mesh"
when DerivedMesh wasn't used.
2024-03-29 13:29:30 +11:00
Hans Goudey ce9970c76b Cleanup: Remove duplicate function for copying edit mesh positions 2024-03-28 21:43:32 -04:00
Hans Goudey e6808cd558 Cleanup: Make format 2024-03-28 20:55:23 -04:00
Jesse Yurkovich f62f8852dc Cleanup: Remove BLI_array macros in editmesh_knife
This replaces the older dynamic c array macros with blender::Vector in
editmesh_knife. This area is 1 of only 2 remaining which use this
machinery.

See #103343

Pull Request: https://projects.blender.org/blender/blender/pulls/119976
2024-03-29 01:51:55 +01:00
Jesse Yurkovich af7a34dee7 ImportHelper: Common methods for FileHandler drag and drop support
Provide common implementations for two operations that all Python
FileHandlers will typically use.

- `poll_file_object_drop` To be used inside the FileHandler `poll_drop`
   callback
- `invoke_popup` To be used inside the Operator `invoke` callback

The above code closely mirrors what is currently done inside the
existing Blender c++ FileHandlers.

Pull Request: https://projects.blender.org/blender/blender/pulls/119774
2024-03-29 01:22:51 +01:00
Harley Acheson 6dd0f6627e UI: Removal of Five Operator Confirmations
Removal of confirmation dialogs for the following five operators. For
each of these the UI module felt that they are all either very explicit
actions and/or are easily undone.
* ARMATURE_OT_separate (Move selected bones to a separate armature)
* CURVE_OT_separate - “Move selected points to a new object”
* OBJECT_OT_vertex_parent_set (Parent selected ob to selected vertices)
* OBJECT_OT_parent_no_inverse_set (Make Parent w/o inverse correction)
* FILE_OT_directory_new - (Create New Directory)

Pull Request: https://projects.blender.org/blender/blender/pulls/120036
2024-03-29 01:09:15 +01:00
Campbell Barton 01dceb6b89 Cleanup: remove redundant checks for known states 2024-03-29 10:30:42 +11:00
Campbell Barton 3cfd4b4aba Cleanup: simplify check for the existence of key-blocks
The active key was accessed to check if the key-blocks were empty,
the variable was then shadowed by the iterator.

Check if the key blocks list is empty instead.
2024-03-29 10:13:06 +11:00
Campbell Barton 99f93aa4c8 Cleanup: assign object & space variables from the context for reuse 2024-03-29 10:08:59 +11:00
Campbell Barton ff92a23fe6 Cleanup: odd indentation, also assign a variable for reuse 2024-03-29 10:07:28 +11:00
Campbell Barton a2dae7e4b4 Cleanup: consistent quotes for Python scripts 2024-03-29 10:07:28 +11:00
Sean Kim 6e997cc757 Sculpt: Add Line Hide tool
This PR adds the *Line Hide* tool and the corresponding
`PAINT_OT_hide_show_line_gesture` operator to Sculpt Mode.

*Line Hide* supports common modal functionality including:
* Snapping to angles
* Flipping the selection area
* Moving selection area

Addresses one of the tools in #80390

Pull Request: https://projects.blender.org/blender/blender/pulls/119671
2024-03-29 00:05:25 +01:00
Hans Goudey bf04da96f3 Fix: Missing change in declaration from previous commit 2024-03-28 19:01:32 -04:00
Hans Goudey 82b88f130a Cleanup: Use const for evaluated cage meshes and related data
Also access the evaluated deform mesh with a function rather than
directly from object runtime data. The goal is to make it easier to use
implicit sharing for these meshes and to improve overall const
correctness.
2024-03-28 18:57:57 -04:00
Hans Goudey 510874f7b9 Mesh: Limit threading for copying positions to GPU data
See b99c1abc3a for more information about how using fewer
threads for just copying data can improve performance. In my simple
test file with mesh data re-uploaded every frame, this improved
performance from 23.5 FPS to 25.5 FPS (almost 9%).
2024-03-28 18:37:23 -04:00
Hans Goudey 5ed99e6361 Cleanup: Remove unused MeshRenderData variable 2024-03-28 18:28:35 -04:00
Hans Goudey 931206d3dc Cleanup: Rename mesh face deformed edit position variables
Use standard naming similar to their `Mesh` counterparts.
2024-03-28 18:28:35 -04:00
Hans Goudey 72347f11fe Cleanup: Use float3, Span, Array for vertex positions 2024-03-28 18:28:35 -04:00
Germano Cavalcante 5bdfec8d67 Fix: unhandled empty Optional in 'bounds_min_max()'
Continuation of fcfce8f69f
2024-03-28 18:59:33 -03:00
Hans Goudey 90c53d265b Cleanup: Outliner: Return early, reduce variable scope 2024-03-28 16:40:15 -04:00
Hans Goudey 9132679f1b Fix #119571: Weight paint vertex selection invisible
After bace4c9a29, the vertex position and vertex normal VBOs
are split. The `overlay_paint_point` shader depends on the normals VBO
because the selection is stored in the `.w` component of the vector.
2024-03-28 15:47:34 -04:00
Hans Goudey 684dbba6a1 Fix #119969: Crash rendering in sculpt mode with multires active
SubdvigCCG is null for the evaluated mesh in the render depsgraph
because of the `!for_render` check in `MOD_multires.cc`. But the PBVH
type is still `PBVH_GRIDS`. That's a weird inconsistency that ideally
wouldn't happen, but probably isn't simple to change. The simplest and
most obviously harmless fix is to just check whether the list of PBVH
nodes to update is empty.
2024-03-28 15:11:02 -04:00
Hans Goudey 0b80d5e755 Cleanup: Access sharp_face attribute with attribute API 2024-03-28 14:45:56 -04:00
Jesse Yurkovich b37e825d89 Fix: MSVC ICE in MatBase stream output operator
Recently an internal compiler error has been popping up for folks
stemming from our MatBase matrix `operator<<`.

My guess is that the nested fold-expression (coming from `unroll`) and
the lambda is causing MSVC to become very upset in some instances.

Regardless of the actual cause, using simple for loops results in less
generated code and the use of `unroll` isn't required since these output
operators are mainly for debugging.

Unfortunately I've been unable to reproduce it in simpler contexts to
report it upstream.

Pull Request: https://projects.blender.org/blender/blender/pulls/119982
2024-03-28 19:31:18 +01:00
Hans Goudey a5c5cf473e Fix #119992: Object transform ignored for shrinkwrap and flat shading
the transform was always ignored for face normals since b4b224dc08.
2024-03-28 13:43:20 -04:00
Hans Goudey d5a61a8f55 Fix: Missing early return when asset isn't found
This didn't cause a crash since `resolve_asset_weak_reference_to_full_path`
doesn't actually use the `this` pointer, but it's still quite unsafe.
2024-03-28 13:43:20 -04:00
Hans Goudey a7cdb9e94d Cleanup: Use "this" keyword to access class methods 2024-03-28 13:43:20 -04:00
Hans Goudey f8e8e3ac8c Cleanup: Use utility mixins for AssetRepresentation 2024-03-28 13:43:20 -04:00
Falk David 8b7d5f8587 GPv3: Simplify Modifier
Implements the GPv2 simplify modifier.

Pull Request: https://projects.blender.org/blender/blender/pulls/120018
2024-03-28 18:16:14 +01:00
Sergey Sharybin 598819049e Fix #120007: Crash rendering when using OptiX and Grease Pencil on recent drivers
The issue seems to be caused with the recent NVidia drivers, which will
crash if OptiX context is created prior to the OpenGL context on Linux.
This happens with drivers 545.29.06, 550.54.14, 550.67 and kernel 6.8
on Ubuntu 24.04, and also happens with NVidia driver 550.67 on Gentoo.

While it does seem the issue is likely on the driver side, the timeline
for it being resolved there is unknown. Until then it is possible to
apply workaround on Blender side, which will initialize GPU context
prior to rendering with an external render engine when it is known the
GPU context will be needed later on.

Note this is not a complex fix, because in general it's still possible to
render a frame without and then with grease pencil, in which case OptiX
will still be initialized first. But we don't want to always initialize
OpenGL, and we can't predict future operations.

Pull Request: https://projects.blender.org/blender/blender/pulls/120026
2024-03-28 18:00:30 +01:00
Falk David e3a02b9b02 Fix: GP: Vertex Paint is very slow in heavier files
For some reason, the vertex paint modal operator
was calling `CTX_data_ensure_evaluated_depsgraph` on
every event update. For obvious reasons, this caused
performance to go down drastically in bigger files.
Specifically in one of the Blender Studio files.

The fix uses `CTX_data_depsgraph_pointer` instead to
get the `Depsgraph` pointer, avoiding a full reevaluation
of the scene.
2024-03-28 17:11:16 +01:00
Christoph Lendenfeld fdf75dcf99 Refactor: Remove duplicate function `get_keyframe_values`
No functional changes.

The function `get_keyframe_values` existed twice.
Once in a legacy state, which also did NLA logic.
And also in a new implementation where it only returned keyframe values.

This PR removes the legacy function and moves the NLA logic to a separate function.

Pull Request: https://projects.blender.org/blender/blender/pulls/119798
2024-03-28 17:00:21 +01:00
Brecht Van Lommel 451bf56409 Fix #120015: Weight paint crash with shift to blur 2024-03-28 16:42:21 +01:00
Brecht Van Lommel 0334ce5666 Tests: Update references for EEVEE, Workbench, Storm 2024-03-28 16:29:26 +01:00
Falk David 5a6a9349e0 Revert "GPv3: Simplify modifier"
This reverts commit 279b8b5748.

The PR wasn't accepted.
2024-03-28 15:23:42 +01:00
YimingWu 279b8b5748 GPv3: Simplify modifier
Implements the simplify modifier from GPv2.

Co-authored-by: Falk David <falk@blender.org>
Pull Request: https://projects.blender.org/blender/blender/pulls/118546
2024-03-28 15:18:33 +01:00
Jeroen Bakker 47226f68ef Fix #119800: EEVEE-Next: Planar probe debug display
The planar probe display had artifacts. This PR
fixes them by displaying the world when the planar probe
doesn't contain a reflection on that given pixel.

Pull Request: https://projects.blender.org/blender/blender/pulls/120011
2024-03-28 15:15:09 +01:00
Christoph Lendenfeld 6276dd2f64 Fix #119946: NLA stack decomposition doesn't work with bones
The issue was that the `PointerRNA` passed to `BKE_animsys_get_nla_keyframing_context`
needs to point to an `ID` which wasn't the case when keying bones.
That is because internally the `FCurve` path is used to resolve the property.
This can only work from the `ID` because the `FCurve` path is always stored relative to that.
While the function doesn't fail when the property can't resolve the path, it won't actually do
the remapping when passing it to `BKE_animsys_nla_remap_keyframe_values` later.

Pull Request: https://projects.blender.org/blender/blender/pulls/120008
2024-03-28 15:14:01 +01:00
Germano Cavalcante 7f3be1ddd8 Fix: Remove reference to non-existing "use_snap_uv_grid_absolute"
Also add missing renames from f66cb1e635
2024-03-28 10:08:56 -03:00
Bastien Montagne 71fd693d22 GPv3: Conversion: Add some support for GPData animation itself
Handling animation of GPv3 in itself is relatively straightforward, it's
mainly a matter of duplicating animdata into the new GreasePencil ID.

In case some propoerties need to be remapped, this will be done in a
similar way as e.g. GP object's modifiers animation for Object-level
animation.

The complex and ugly part of this PR is in the need to move animation
from GPdata to Object level for some properties. This PR tackles the
'layer adjustments to modifiers' aspect (i.e. adjustments on tint and
thickness).

Known limitations currently with these GPData to Object animation:
* NLA is not supported (i.e. if an NLA in legacy GP data controls these
  adjustments animations, it won't be converted to Object-level NLA to
  control matching modifiers settings).
* Drivers targets are not handled either, i.e. in case a driver is using
  data from legacy GPdata as input, these will be left as-is (this is
  true for all anim handling currently).
* There is no adjustments of values for animation (e.g. the thickness
  adjustment values would need to be devided by 2000).

Most of these limitations can be addressed at some point, depending on
how critical they are to support. This would have a cost (in time and
code complexity) though.

Pull Request: https://projects.blender.org/blender/blender/pulls/119214
2024-03-28 13:52:21 +01:00