Commit Graph

107469 Commits

Author SHA1 Message Date
Matias Mendiola
d5517e8d93 GPv3: Fix: Avoid the creation of new objects for empty material slots when separating by material
This PR fix the creation of new objects for empty material slots

Pull Request: https://projects.blender.org/blender/blender/pulls/119062
2024-03-05 12:17:03 +01:00
Bastien Montagne
15ccec1edb Merge branch 'blender-v4.1-release' 2024-03-05 11:59:59 +01:00
Lukas Tönne
01f794a7d5 GPv3: Fix outline modifier edge cases
Fixes behavior of the outline modifier in some edge case:

- When the outline radius gets larger than the input stroke radius it
  caused a negative offset, inverting the outline in thin areas like the
  tips of the default stroke. The offset should always remain positive
  or zero (collapses onto the input curve).
- When the outline collapses the modifier was skipping points on outside
  corners, where at least one point should be added in all cases.

Pull Request: https://projects.blender.org/blender/blender/pulls/119084
2024-03-05 11:57:36 +01:00
Bastien Montagne
1906ee76ba Fix (studio-reported) IDproperties of liboverrides not being animatable.
Regression from 427eed292d, in IDProperty case the 'ensured' PropertyRNA
pointer is some sort of empty template, and cannot be used for many
things.

Instead of calling `rna_ensure_property` twice for each call to
`RNA_property_animateable`, rather add an optional parameter to static
helper `rna_property_editable_do`, and call it directly from
`RNA_property_animateable`.
2024-03-05 11:53:06 +01:00
Pratik Borhade
690679e3ce GPv3: Length modifier end property not working
When `random_(end/start)_factor` is non-zero, the `end segment` property
won't have any effect on the curves end. This is accidently controlled by `start_fac`.

Resolves #119059

Pull Request: https://projects.blender.org/blender/blender/pulls/119074
2024-03-05 11:51:29 +01:00
Lukas Tönne
3f43f83b8a GPv3: Fix jittery miter points by the outline modifier
With the default GPv3 "Stroke" object the outline modifier generates
jittery strokes. It also generates full circles at various points along
the input stroke.

The outline modifier chooses a normal from the camera view. In the
default GPv3 stroke test the camera views the stroke from an angle.
In that case the curve has a significant Z component out of the plane,
which breaks normalization of the 2D component and causes excessive
miter scaling.

The full circles are caused by bad angles, the range should be `(-pi,pi)`
rather than `(0,2*pi)`.

Pull Request: https://projects.blender.org/blender/blender/pulls/119067
2024-03-05 11:07:45 +01:00
Omar Emara
d6b1d00a0f Cleanup: Use enums instead of numbers for Glare node 2024-03-05 11:51:52 +02:00
Bastien Montagne
db4ef876c6 Merge branch 'blender-v4.1-release' 2024-03-05 10:05:47 +01:00
Bastien Montagne
6adf5adb7f Fix LibOverride asserting when same RNA path changes type.
Although rare (and not recommended!), it can happen that a same exact
RNA path points to a different type of data.

This can come from an update of the code itself, but this is very
unlikely and discouraged.

However, geometry nodes and their 'modifiers' interface have made it way
more easy to create such conflicting situation, since users are free to
re-arrange and edit the nodes and their 'public' interface as they
want...

Found out while investigating some unrelated issues in some studio Gold
production files (namely,
`pro/shots/090_joining_whale/090_0130/090_0130-anim.blend` r2110
exhibits such issue for `OBGEO-mika-body`
`modifiers["RIG-GN-mask-clothing"]["Socket_3"]`, where the RNA type
changes from integer to bool).
2024-03-05 10:03:44 +01:00
Omar Emara
eb91828aab GPU: Add maximum image units to GPU capabilities
This patch adds the maximum number of supported image units to the GPU
capabilities module. Currently, the GPU module assume a maximum of 8
units, so the patch is not currently particularly useful, but we can
consider committing it for the future anyways.

Pull Request: https://projects.blender.org/blender/blender/pulls/119057
2024-03-05 07:25:20 +01:00
Campbell Barton
d27ddccc60 Cleanup: use macro to avoid repetition in BPY_init_modules 2024-03-05 13:54:17 +11:00
Campbell Barton
ed5fb3eaba Cleanup: various non-functional C++ changes 2024-03-05 11:32:42 +11:00
Campbell Barton
e011c1ab9b Cleanup: spelling in comments 2024-03-05 11:25:35 +11:00
Campbell Barton
76867ad4c2 Cleanup: redundant "void" in function declarations for C++ 2024-03-05 11:25:35 +11:00
Campbell Barton
b8cc85f602 Unbreak build with precompiled headers disabled 2024-03-05 11:25:35 +11:00
Hans Goudey
6479dc50fa Refactor: Mesh: Use C++ threading API for tessellation
This allows deleting a bunch of duplicate code, since there doesn't
need to be a special single-threaded case anymore. It also just
reduces the necessary boilerplate.

Also change naming a bit and use signed integers instead of unsigned.

I didn't notice any performance difference.

Pull Request: https://projects.blender.org/blender/blender/pulls/119069
2024-03-05 01:03:45 +01:00
Campbell Barton
5fdd684550 Merge branch 'blender-v4.1-release' 2024-03-05 10:20:52 +11:00
Campbell Barton
8842982dbd Docs: note the temporary directory will be ignored unless it exists
Other minor changes:

- Remove reference to `TMP` environment variable in the `--help` text
  as this isn't a posix standard and is noted as something that may be
  removed in the future.
- Show WIN32 `TEMP` when showing all help text so it will be included
  in the user manual.
2024-03-05 10:19:16 +11:00
Campbell Barton
c789a938d9 Cleanup: remove temporary directory creation 2024-03-05 09:54:49 +11:00
Hans Goudey
ce80cc1526 Cleanup: Remove unused UI button creation function
Last used over 11 years ago apparently.
2024-03-04 12:22:50 -05:00
Omar Emara
82448c1e4d Fix: Typo in latest commit
The named identity constructor was mistyped.
2024-03-04 19:19:06 +02:00
Omar Emara
4ab6feb5bd Fix: GPU Compositor results are sometimes clipped
Compositor outputs are sometimes clipped. That's because consecutive
shader operations in the GPU compositor were assumed to have the same
domain. So make sure to reset the domain during compile unit resets.
2024-03-04 19:16:07 +02:00
Omar Emara
19188582b0 Cleanup: Remove unused return 2024-03-04 19:15:06 +02:00
Sybren A. Stüvel
a1b10f85cd Refactor: Anim, split up FCurve-reading/writing code
Split `BKE_fcurve_blend_write(writer, listbase)` into two functions:
- `BKE_fcurve_blend_write_data(writer, fcurve)` for the data of a single
  F-Curve, and
- `BKE_fcurve_blend_write_listbase(writer, listbase)` for writing a list
  of F-Curves.

And the same for `BKE_fcurve_blend_read_data()`.

This is necessary for the upcoming Animation data-block, which will
store F-Curves as arrays instead of `ListBase`s.

No functional changes.
2024-03-04 17:50:14 +01:00
Iliya Katueshenock
fa229c5753 Fix #119019: Geometry Nodes: Split to Instances wrong field interface
Input fields should propagated on input geometry.

Pull Request: https://projects.blender.org/blender/blender/pulls/119032
2024-03-04 16:57:28 +01:00
Lukas Tönne
d6aadd6692 GPv3: Outline modifier
Port of GPv2 outline modifier.

Pull Request: https://projects.blender.org/blender/blender/pulls/118911
2024-03-04 16:54:07 +01:00
Sebastian Parborg
6290ead143 Merge branch 'blender-v4.1-release' 2024-03-04 16:53:54 +01:00
Sebastian Parborg
a8cc2e4d96 Fix: Add missing iostream include
Without this include compilation would sometimes fail
2024-03-04 16:50:47 +01:00
Hans Goudey
5f16d23971 Fix: Null pointer dereference in node editor ID remapping
This didn't cause a crash because `offsetof(bNodeTree, id) == 0`.
But still, it is wrong.
2024-03-04 10:36:21 -05:00
Raul Fernandez
3c6a9cb5a5 Fix #117824: Sculpt color filter crash
Fix for Sculpt: Color Filter crash #117824

This change fixes the crash due to invalid active color layer
in the Undo/Redo stack when redoing from the original state.

Previously when performing a redo to a filter color state from the
original state, it cased a crash because
&((SculptUndoStep *)us_iter)->active_color_start did not contain valid
color data in the original state.
In this PR we check if is the original state and use the
&((SculptUndoStep *)us_iter)->active_color_end instead which is
de correct data to use.

- [x] Fix color update  when redo from initial state

Pull Request: https://projects.blender.org/blender/blender/pulls/118885
2024-03-04 16:31:52 +01:00
Hans Goudey
31f6d4db89 Fix: Incorrect assert in OBJ mesh edge creation
Typo in 2a4323c2f5
2024-03-04 10:11:38 -05:00
Hans Goudey
0673cd873d Fix: Incorrect viewer preferred domain for some curve fields
Mentioned by https://pvs-studio.com/en/blog/posts/cpp/1106/
2024-03-04 10:11:37 -05:00
Miguel Pozo
fd459ae82c Fix #117977: EEVEE-Next: Broken shadows with 1GB pool size
shadow_page_unpack clamps the result to a valid page range, causing
all pages that shouldn't be rendered to render to the last valid page.

Pull Request: https://projects.blender.org/blender/blender/pulls/118979
2024-03-04 16:01:02 +01:00
YimingWu
4f70190a01 Fix #119026: GPv3: Stack use after scope
The arrays `modified_starts` and `modified_ends` was freed early
due to wrong variable scope, this leads to incorrect randomize length
effect in length modifier. Now fixed.

Pull Request: https://projects.blender.org/blender/blender/pulls/119054
2024-03-04 15:30:08 +01:00
Hans Goudey
2fe717df58 Cleanup: Make format 2024-03-04 09:22:32 -05:00
YimingWu
b3e46b65b9 GPv3: Fix: Memory corruption after modifier conversion
The switch branches are not laid out in correct order and without
`break`s between some of them, leading to wrong conversion results.

Pull Request: https://projects.blender.org/blender/blender/pulls/119052
2024-03-04 13:34:21 +01:00
Bastien Montagne
afb5cb440b Fix/tweak UI messages (typos etc.). 2024-03-04 11:17:55 +01:00
Sietse Brouwer
ad8180c54c GPv3: Copy and Paste operators for copying strokes and points
This PR implements the Copy and Paste operators for GPv3. The operators
are available in Edit Mode. The Copy operator copies the selected strokes/
points to a clipboard. The Paste operator pastes the  strokes/points from
the clipboard to the active layer.

Keyboard shortcuts:
- `Ctrl`-`C` for copy
- `Ctrl`-`V` for paste
- `Ctrl`-`Shift`-`V` for paste in the back (behind all existing strokes)

Pull Request: https://projects.blender.org/blender/blender/pulls/114145
2024-03-04 11:02:25 +01:00
YimingWu
d0c9246fcc Fix #119022: GPv3: Noise modifier seed per stroke
Use seed per stroke for grease pencil v3 noise modifier.

Pull Request: https://projects.blender.org/blender/blender/pulls/119024
2024-03-04 10:58:34 +01:00
Lukas Tönne
64bb63dcb0 Fix #118962: Skip setting not taken into account looping over points
The GPv3 envelope modifier was computing the correct number of strokes
to generate, but then not actually skipping over points. Result is that
all envelope strokes got added at the beginning instead of the whole
point range.

Pull Request: https://projects.blender.org/blender/blender/pulls/119023
2024-03-04 10:57:17 +01:00
Casey Bianco-Davis
bb26c3d82f GPv3: Draw tool: Only create caps attributes if needed
This is to stop unneeded attributes from been created.

Pull Request: https://projects.blender.org/blender/blender/pulls/118985
2024-03-04 10:55:42 +01:00
Omar Emara
38caa87b09 Fix: Corner Pin node gizmo is too small
The Corner Pin node gizmo is too small to be used, so increase its size
to match the size of other node gizmos to improve usability.
2024-03-04 10:19:51 +02:00
Omar Emara
983643c78c Fix: Flat filter in Blur node is wrong in bokeh mode
The Flat filter was wrongly assumed to be separable, white it is in fact
not. So compute it as a 2D filter in bokeh mode to fix this.
2024-03-04 10:07:25 +02:00
Prakhar Singh Chouhan
4ce13fe198 Python: Add deprecation warnings to GPUBatch program usage
Calls to `gpu.types.GPUBatch.draw#program` without a program parameter,
or a None as value of the program parameter now raises a deprecation warning.

Implements #103978
2024-03-04 08:32:51 +01:00
Jesse Yurkovich
7bf4247b09 Depsgraph: add a DEG_graph_build_from_collection convenience function
This adds a new `DEG_graph_build_from_collection` function and related
pipeline to more easily build a graph of all relevant IDs from a given
Collection.

It was modeled after the `FromIDsBuilderPipeline` with the difference
being that the list of IDs is gathered from the Collection rather than
passed in. It also slightly differs in that the filtering class shares a
common `Set` rather than building it twice, once for the node builder
and once for the relation builder.

It will eventually be used for the Collection IO project where various
IO exporters will be tied to a Collection and will be limited to just
IDs contained in said Collection.

Pull Request: https://projects.blender.org/blender/blender/pulls/118732
2024-03-04 06:25:33 +01:00
Campbell Barton
5af4987456 Merge branch 'blender-v4.1-release' 2024-03-04 12:21:50 +11:00
Campbell Barton
51126fab33 BLI_tempfile: ensure the temporary directory is absolute
While unreported, there is nothing preventing CWD relative temporary
directories being used. Resolve asserts & errors if the CWD changes at
run-time.
2024-03-04 12:20:44 +11:00
Campbell Barton
1b514659ca Cleanup: minor changes to temp directory API
- Pass null instead of an empty string to BKE_tempdir_init
  because the string isn't meant to be used.
- Never pass null to BLI_temp_directory_path_copy_if_valid
  (the caller must check).
- Additional comments for which checks are performed & why
  from discussion about #95411.
2024-03-04 11:42:02 +11:00
Jesse Yurkovich
b0daa792d3 Merge branch 'blender-v4.1-release' 2024-03-03 13:53:47 -08:00
Guillermo Venegas
8f68dfe0c2 Fix #119000: File handler extension check should be case insensitive
Allows case insensitive extension match.

Pull Request: https://projects.blender.org/blender/blender/pulls/119018
2024-03-03 22:50:51 +01:00