Commit Graph

3541 Commits

Author SHA1 Message Date
Campbell Barton
937776b555 Cleanup: sort CMake file lists 2024-04-01 16:48:44 +11:00
Campbell Barton
add3c6a3b1 Correction to commenting unused axis_v from last commit 2024-04-01 15:51:35 +11:00
Campbell Barton
3ecc626c3d Cleanup: comment unused variable 2024-04-01 15:48:35 +11:00
Lukas Tönne
d7c718dfd4 GPv3: Texture offset modifier
Port of the GPv2 texture modifier for transforming UVs of stroke points.

Pull Request: https://projects.blender.org/blender/blender/pulls/119050
2024-03-29 21:42:30 +01:00
Falk David
60e648a7e6 Fix: GPv3: Simplify modifier inconsistency with GPv2
The simplify modifier did not remove points in fixed mode
at level 1. This was the case in GPv2.
This makes sure to get the same result as in GPv2.
2024-03-29 16:48:36 +01:00
Falk David
96de8112ee Fix: GPv3: Crash in simplify modifier
The simplify modifier uses
`bke::curves_copy_point_selection` but didn't
build the `points_to_keep` index mask correctly.
This fixes the indices in the index mask and also
optimizes the edge cases of removing all the points/
keeping all the points.
2024-03-29 16:13:44 +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
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
72347f11fe Cleanup: Use float3, Span, Array for vertex positions 2024-03-28 18:28:35 -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
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
Hans Goudey
7c01355cad Cleanup: Use forward declaration headers in a few places 2024-03-27 22:25:08 -04:00
Hans Goudey
c28db1f0a0 Cleanup: Use C++ namespace for object editors module
Move the public functions from the editors/object (`ED_object.hh`)
header to the `blender::ed::object` namespace, and move all of the
implementation files to the namespace too. This provides better code
completion, makes it easier to use other C++ code, removes unnecessary
redundancy and verbosity from local uses of public functions, and more
cleanly separates different modules.

See the diff in `ED_object.hh` for the main renaming changes.

Pull Request: https://projects.blender.org/blender/blender/pulls/119947
2024-03-28 01:30:38 +01:00
Hans Goudey
0cdd429b44 Cleanup: Use newer API for creating IDProperties in most places
There are still a few places that are more complicated where the replacement
to `IDP_New` isn't obvious, but this commit replaces most uses of the ugly
`IDPropertyTemplate` usage.
2024-03-26 15:39:39 -04:00
Hans Goudey
e0567eadbd Cleanup: Use FunctionRef for IDProperty iteration callback
Avoid the need for a seaprate user_data argument.
2024-03-26 15:39:39 -04:00
Hans Goudey
efee753e8f Cleanup: Move BKE_idprop.h to C++ 2024-03-26 13:07:04 -04:00
Hans Goudey
f41ab9abc1 Cleanup: Combine BKE_idprop C and C++ headers
In preparation for moving the whole BKE_idprop.h to C++.
To keep the git history intact we remove the newer smaller file.
2024-03-26 13:07:04 -04:00
Hans Goudey
3805974b6f Refactor: Use C++ array for edit mesh looptris
Pull Request: https://projects.blender.org/blender/blender/pulls/119829
2024-03-23 17:43:38 +01:00
Hans Goudey
c61ecf1f40 Cleanup: Move Mesh edit_mesh pointer to runtime data
The edit mesh is never saved to files, so it should be in the runtime struct.

Pull Request: https://projects.blender.org/blender/blender/pulls/119766
2024-03-21 23:18:49 +01:00
YimingWu
3689dfca4f GPv3: Build Modifer migration
Reimplemented build modifier using the new `CurvesGeometry` logic.

Pull Request: https://projects.blender.org/blender/blender/pulls/118739
2024-03-20 13:28:28 +01:00
Hans Goudey
972c52feb9 Cleanup: Use enum class for boolean operation
Similar to the recently introduced `Solver` enum. This is just friendlier
and doesn't require including `DNA_node_types.h` in the geometry
module header. There's no strong benefit to declaring these enums in
DNA in practice.
2024-03-14 17:24:27 -04:00
Howard Trickey
e3f030cce6 Geometry Nodes: Add float solver to mesh boolean node
This adds a "Solver" option to the geo boolean node, with the options
Exact and Float.
The current geo boolean node only uses the Exact solver.
This adds the ability to use the faster original floating point boolean solver.
The float solver has issues with coplanar and other coincident geometry,
but is generally much faster than the Exact solver, and users have asked
for this option (which is available in the Boolean Modifier and edit mode
boolean tool).

Like the modifier, the Float solver needs to convert the Mesh to BMesh,
do the operation, and then convert back to Mesh. It also has to do it
iteratively if more than two operands are supplied.

This is the first of a planned series of commits that will add a
new exact boolean solver, based on the Ember paper, as a solver option.
Ember will be much faster than the current exact solver, but may still not
be as fast as float, and also will not handle some non-volume-enclosing
inputs as well as Float, so it is likely that the Float solver will always remain.
We may eventually retire the old Exact Solver, however.

This commit also prepares for more sensible code in the future by
changing the internal enum names for the solvers to better reflect the
algorithms used: Fast -> Float, and Exact -> Mesh_Arr (which means
"Mesh Arrangments, the name of the paper upon which the current
exact solver is based).

Co-authored-by: Howard Trickey <trickey@google.com>
Co-authored-by: Hans Goudey <hans@blender.org>
Pull Request: https://projects.blender.org/blender/blender/pulls/119294
2024-03-14 20:49:57 +01:00
Jacques Lucke
68c5e35be1 Merge branch 'blender-v4.1-release' 2024-03-12 17:33:59 +01:00
Sean Kim
1982cad490 Fix: update comparator for std::sort for NamedAttribute
This PR applies a fix for the comparator being passed into std::sort to
avoid potential Mac / libc++ issues as seen in #119189

Pull Request: https://projects.blender.org/blender/blender/pulls/119385
2024-03-12 17:31:02 +01:00
Howard Trickey
17b2ff6119 Refactor: rename files mesh_boolean_convert to mesh_boolean.
A follow-up to previous commit that moved these files to geometry.
The _convert suffix made sense at one point but is now just confusing.
2024-03-12 07:00:33 -04:00
Howard Trickey
70fa3becad Refactor: Move mesh_boolean_convert from blenkernel to geometry.
Header file is renamed to GEO_mesh_boolean_convert.cc and
files that included it are updated to use that path.
This is in preparation for bigger changes to the internal
boolean API, which make more sense as a "geometry" API
than a kernel API.

Pull Request: https://projects.blender.org/blender/blender/pulls/119336
2024-03-11 18:17:57 +01:00
Casey Bianco-Davis
af6d09b439 Fix: GPv3: Armature modifier crash when vertex groups are empty
A debug error was thrown when the armature modifier was added to a GPv3
object that did not have vertex groups.

Pull Request: https://projects.blender.org/blender/blender/pulls/119301
2024-03-11 10:54:23 +01:00
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
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
Campbell Barton
f3e0e39df5 Cleanup: use const pointers where camera data isn't modified 2024-03-08 17:15:08 +11:00
Campbell Barton
cb4351665a Cleanup: format, trailing space 2024-03-08 11:31:01 +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
Anthony Roberts
445fd42c61 Windows: Add ARM64 support
* Only works on machines with a Qualcomm Snapdragon 8cx Gen3 or above.
  Older generation devices are not and will not be supported due to
  some driver issues
* Requires VS2022 for building.
* Uses new MSVC preprocessor for sse2neon compatibility.
* SIMD is not enabled, waiting on conversion of blenlib to C++.

Ref #119126

Pull Request: https://projects.blender.org/blender/blender/pulls/117036
2024-03-06 16:14:34 +01:00
Lukas Tönne
e3c0f64154 GPv3: Fix outline modifier unstable end cap direction
The angle of the outline modifier caps was computed in a [-pi, +pi)
interval, but this creates an unstable situation for angles close to
180. Small variation can lead the angle to flip from +180 to -180 and
change the direction of the semi-circle. Instead generate arcs always
in counter-clockwise direction and use angles in the [0, 2pi) intverval.
This creates stable directions for end caps and also allows larger
arcs where necessary.

Pull Request: https://projects.blender.org/blender/blender/pulls/119122
2024-03-06 12:40:46 +01:00
Lukas Tönne
f51e93bec7 GPv3: Shrinkwrap modifier
Port of shrinkwrap modifier from GPv2.

Adds a new API function in `BKE_shrinkwrap.hh` for the modifier.

Pull Request: https://projects.blender.org/blender/blender/pulls/119118
2024-03-06 12:05:00 +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
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
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
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
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
Lukas Tönne
68c12fe0ec GPv3: Envelope Modifier
Ports the Envelope modifier from GPv2.

Pull Request: https://projects.blender.org/blender/blender/pulls/118272
2024-03-01 10:42:41 +01:00
Hans Goudey
121ded625f Cleanup: Remove unnecessary a1 and a2 arguments for some UI functions 2024-02-29 22:39:37 -05:00
Hans Goudey
d338261c55 Cleanup: Pass Span by value
Also pass Span instead of `const Array &`
and use parantheses for BLI includes.
2024-02-27 23:09:54 -05:00
Kévin Dietrich
ea256346a8 Alembic/USD: Use GeometrySets to import data
This rewrites the Alembic and USD data importers to work with and
output GeometrySets instead of Meshes.

The main motivation for this change is to be able to import properly
point clouds, which are currently imported as Meshes, and curves
data, which suffer from a lot of issues due to limitations of
legacy curves structures (fixed by the new curves data-block) and are
also converted to Meshes. Further, for Curves, it will allow importing
arbitrary attributes.

This patch was primarily meant for Alembic, but changes to USD import
were necessary as they share the same modifier.

For Alembic:
There should be no behavioral changes for Meshes
Curves are imported as the new Curves object type
Points are imported as PointClouds

For USD:
There should be no behavioral changes for Meshes
Curves are imported as the new Curves object type
Note that the current USD importer does not support loading PointClouds,
so this patch does not add support for it.

For both Alembic and USD, knots arrays are not read anymore, as the new
Curves object does not expose the ability to set them. Improvements can
be made in the future if and when example assets are provided.

This fixes at least the following:
#58704: Animated Alembic curves don't update on render
#112308: Curves have offset animations (alembic / USD)
#118261: wrong motion blur from usd in cycles and reverting to the first
frame when disabeling motion blur

Co-authored-by: Jesse Yurkovich <jesse.y@gmail.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/115623
2024-02-28 03:02:38 +01:00
Campbell Barton
7db790c4b7 Cleanup: spelling in comments 2024-02-28 12:13:20 +11:00
Jacques Lucke
086b808671 Merge branch 'blender-v4.1-release' 2024-02-27 20:40:29 +01:00