Commit Graph

101015 Commits

Author SHA1 Message Date
Hans Goudey
ca7f4122da Cleanup: Unused variable in mesh writing, C++ casting 2023-07-07 07:35:56 -04:00
Hans Goudey
7830d9f21e Cleanup: Correct two curves and mesh comments 2023-07-07 07:10:41 -04:00
Hans Goudey
91b27ab637 Refactor: Simplify mesh edit mode modifier evaluation
Instead of keeping track of a local array of positions in the modifier
stack itself, use the existing edit mode SoA "edit cache" which already
contains a contiguous array of positions. Combined with positions as a
generic attribute, this means the state is contained just in the mesh
(and the geometry set) making the code much easier to follow.

To do this we make more use of the mesh wrapper system, where we can
pass a `Mesh` that's actually stored with a `BMesh` and the extra
cached array of positions. This also resolves some confusion-- it was
weird to have the mesh wrapper system for this purpose but not use it.

Since we always created a wrapped mesh in edit mode, there's no need
for `MOD_deform_mesh_eval_get` at all anymore. That function was quite
confusing with "eval" in its name when it really retrieved the original
mesh.

Many deform modifiers had placeholder edit mode evaluation functions.
Since these didn't do anything and since the priority is node-based
deformation now, I removed these. The case is documented more in the
modifier type struct callbacks.

Pull Request: https://projects.blender.org/blender/blender/pulls/108637
2023-07-07 13:07:15 +02:00
Campbell Barton
d0a9595c0d Cleanup: move BLI_vfont to C++ 2023-07-07 20:37:33 +10:00
Campbell Barton
915929e42f Cleanup: remove unused ParticlePathModifier struct 2023-07-07 16:03:47 +10:00
Campbell Barton
d7cfa51e49 Cleanup: declare const variables 2023-07-07 16:00:50 +10:00
Campbell Barton
40ef6c400b Cleanup: utility function to multiple rctf/rcti 2023-07-07 15:42:07 +10:00
Campbell Barton
23acedd432 Cleanup: code-comments 2023-07-07 15:11:19 +10:00
Campbell Barton
6d608cc6b5 Cleanup: use doxy headers in imbuf 2023-07-07 15:03:49 +10:00
Hans Goudey
827baed610 Mesh: Fix missing multithreading in part of BMesh to Mesh conversion
ebe8f8ce71 and 5669c5a61b added multithreading but
a typo meant it wasn't used for half of the process. Fixing that gives a
30% improvement in my tests, from about 80 to 60 ms converting a grid.
2023-07-06 17:10:21 -04:00
Iliya Katueshenock
1beece5f16 Cleanup: Unused spin lock mutex warning
Pull Request: https://projects.blender.org/blender/blender/pulls/109777
2023-07-06 19:43:40 +02:00
Hans Goudey
ec30217755 Cleanup: Simplify access to next face corner in domain interpolation 2023-07-06 13:40:42 -04:00
Joseph Eagar
4fb86952ed Sculpt: Second attempt at fix #109555: Fix floating-point error. 2023-07-06 10:21:32 -07:00
Almaz-Shinbay
af92de664b Outliner: Port bone elements to new tree-element code design
No user visible changes expected.

Part of #96713, continuation of work started in 249e4df110 and 2e221de4ce.
Refer to these for a motivation and design overview.

Adds a new class for bone elements.

Pull Request: https://projects.blender.org/blender/blender/pulls/109684
2023-07-06 18:43:58 +02:00
Germano Cavalcante
d9829c2f87 View 3D: Refactor code to split functions and remove duplication
No functional changes.

Previously, each navigation operation had its own method for restoring
the 3D View's state upon cancellation.

However, this approach did not provide significant advantages.

The number of affected variables was too small to justify considering
it for performance optimization, and the cancellation code was
duplicated across different operations.

To address this, the present commit unifies all restore code into a
single function:

- `void viewops_data_state_restore(ViewOpsData *vod);`

As a result, the `viewmove_apply_reset` function has been removed.

Moreover, since the state now has a dedicated restore function, it
seemed appropriate to create a function for capturing the state as
well.

Therefore, the code responsible for capturing the state (previously
scattered within `viewops_data_init_navigation`) has been extracted to
create the function:

- `void viewops_data_state_capture(ViewOpsData *vod);`

During this separation process, a potential error in the code was
identified, where the state may not be fully restored.

Although this issue persists, a comment has been added to clarify this
situation.

Pull Request: https://projects.blender.org/blender/blender/pulls/109760
2023-07-06 18:21:36 +02:00
Hoshinova
c9fbbea261 Cleanup: Assign corresponding expressions to variable params.max_distance
Pull Request: https://projects.blender.org/blender/blender/pulls/109328
2023-07-06 18:13:22 +02:00
Julian Eisel
71273df2d5 UI: Draw hierarchy lines for tree-views
Hierarchy lines (like we also have in the Outliner) make it easier to
visually parse the hierarchy, and avoid confusion about nesting level.
Especially when some items have icons and/or collapse chevrons and some
not (thus different levels of visual indentation).
They were planned for #93582 and #107881, also see
https://code.blender.org/2023/05/the-next-big-step-grease-pencil-3-0/#layer-groups.

The drawing is implemented as a general tree-view feature, so all
tree-views with collapsable items (which excludes the spreadsheet
data-set tree view) will get them without further setup.
2023-07-06 17:09:32 +02:00
Germano Cavalcante
74772c6920 Fix #109565: Array modifier changes the Root vertex of Skin modifier
The merging behavior of the Array, Mirror, Screw modifiers has changed
since 4369627e71.

Before, only the customdata of the destination vertex was kept. Source
vertices were completely removed.

With 4369627e71, all vertices in the merge group (whether source or
destination) now have their customdata interpolated.

But this can cause problems for example with the root vertex customdata
of the skin modifier, where if only one of the vertices of the group of
vertices has this flag, the resulting one will also have it.

This commit restores the behavior for the vertices customdata and does
not interpolate it if `do_mix_vert_data` is false.

Pull Request: https://projects.blender.org/blender/blender/pulls/109627
2023-07-06 15:05:33 +02:00
Sybren A. Stüvel
899f2bbe32 Refactor: Animation, prevent incrementing null pointer
Only do `next++` if `next` is a non-`NULL` pointer. This doesn't change
the functionality of the code, but it does prevent a sanitizer warning.

No functional changes.
2023-07-06 11:11:24 +02:00
Pratik Borhade
e73273e24b Animation: Set hardmin/max for frame start and end of action
Currently start and end property of action don't have hardmin/hardmax. This results in an
error when exporting action having extreme range values in FBX and gltf formats (#107965).

Pull Request: https://projects.blender.org/blender/blender/pulls/107985
2023-07-06 10:55:33 +02:00
Damien Picard
bbb18137ff Fix #109114: i18n: FPS not displayed in the viewport in Hindi
The FPS in the viewport is displayed in a string of the form "fps:
%.2f". The string that stores it is of length 16, which is plenty
enough in English. But the translated message in Hindi uses
Devanagari, which takes up 4 bytes per char. Because of this, it is
too long and there is not enough room for the numbers to actually
appear.

To solve this, the containing string length was doubled to 32 chars.

Pull Request: https://projects.blender.org/blender/blender/pulls/109408
2023-07-06 09:38:11 +02:00
Guillermo Venegas
5b3ce7b740 UI: Improve 3d text selection
Improve 3D text selection & feedback when moving the mouse outside of
the text. Previously mouse selection only worked if the mouse was over
the text, now there is more margin to select characters or lines.

Ref !109229

Co-authored-by: Campbell Barton <campbell@blender.org>
Co-authored-by: Harley Acheson <harley.acheson@gmail.com>
2023-07-06 13:25:07 +10:00
Campbell Barton
6a79639ef7 Cleanup: use function style casts, remove void function argument
Also remove redundant parenthesis.
2023-07-06 10:40:25 +10:00
Hans Goudey
c65fa57b0b Fix #109691: Edge crease not handled in complex solidify
a8a454287a which moved edge creases out of `MEdge` only
retrieved the result data array if the mesh had vertex creases. Before
the processing always happened though. So process the result creases
if the input has edge creases too, and try to retrieve an existing array
instead of always adding a new one.
2023-07-05 16:53:22 -04:00
Hans Goudey
2b4666b17b Geometry Nodes: Fill new quad poly offsets in parallel
Add an offset indices utility to do fill constant size new offsets in
parallel, which was already done in the duplicate elements node.

For example, filling poly offsets for a new part of a mesh that is only
quads. In the extrude node this was single-threaded before, so the
new poly offsets is about 10x faster, saving about 10 out of 157 ms
when extruding 2 million faces.
2023-07-05 15:39:33 -04:00
Brecht Van Lommel
4c6653274c Fix full frame compositor crash when Image node can't load image
Ref #109168
2023-07-05 20:51:28 +02:00
Martijn Versteegh
a280e8a68c Fix #107416: Check length of Property Collection before type
In edit mode the uv map data length gets set to zero. The specialized
MLoopUV code used to have a check to detect this when trying to access
the UVs using foreach_get/set . Add this check for the Attribute code
path as well.

Pull Request: https://projects.blender.org/blender/blender/pulls/109179
2023-07-05 20:06:18 +02:00
Jacques Lucke
0b7d8a20bf Cleanup: Move many editors files to C++
This moves the following `editors/*` directories to C++:
- animation, armature, lattice, mesh, metaball, object, scene.

Much of the changes in this commit (inserting casts in particular)
was automated. Further changes like switching to functional style
casts can be done separately by existing automated scripts.

See #103343

Pull Request: https://projects.blender.org/blender/blender/pulls/109715
2023-07-05 20:03:41 +02:00
Martijn Versteegh
cd4848a574 Cleanup: make format 2023-07-05 19:42:52 +02:00
Brecht Van Lommel
c4ddf16950 Cleanup: remove unused light struct member 2023-07-05 19:16:39 +02:00
Brecht Van Lommel
57d85b32a9 Lights: remove unused Blender Internal properties
For falloff, attenuation and shadow buffers.

Pull Request: https://projects.blender.org/blender/blender/pulls/109738
2023-07-05 18:54:36 +02:00
Ray Molenkamp
c591eb1b40 Fix #109596: Xcode project generation fails
Remove dead code that is causing problems with dependencies in Xcode.

Pull Request: https://projects.blender.org/blender/blender/pulls/109751
2023-07-05 18:46:55 +02:00
Hans Goudey
87b8e2e18d Fix #109471: BMesh to Mesh conversion invalid UV boolean attribute data
First we copied the entire BMesh custom data layout to the Mesh, then we
decided not to copy some boolean layers like UV pinning if every value
was false. But that left the layers uninitialized. Instead, copy the
custom data layout _after_ finding which layers to skip.
2023-07-05 12:36:10 -04:00
Miguel Pozo
6ac86d0e81 Workbench Next: Release overlay depth shader
Avoid memory leak.
2023-07-05 18:30:21 +02:00
Miguel Pozo
3d62888ed6 Workbench Next: Fix Overlay composition
Set "In Front" objects depth to 0,
so overlays are not drawn on top of them.
2023-07-05 18:11:50 +02:00
Miguel Pozo
6335af74f2 Workbench Next: Fix transparent depth
transparency_depth_ps_ object sync was being skipped after
a639ec3afa
2023-07-05 18:11:50 +02:00
Julian Eisel
0d57495acf Cleanup: remove accidentally added empty line 2023-07-05 18:03:46 +02:00
Julian Eisel
eb1e8cb4cc Pass context to region polls
Needed for #104831. It makes sense to pass this to the polling, since
polling is typically expected to check context.
2023-07-05 17:56:58 +02:00
Hans Goudey
96ad44a462 Cleanup: Use more explicit casting in mesh RNA code
Also increase use of C++ accessor methods and types.
2023-07-05 10:58:59 -04:00
Hans Goudey
53416281bd BLI: Optimize utility for index counting
The utility counts the number of occurrences of each index in an array.
It's used to build offsets for mesh topology maps, or to count the
number of connected elements. Some users are geometry nodes,
the subdivision draw cache, and mesh to curve conversion.

This PR parallelizes the counting to take advantage of multiple
threads. On a Ryzen 7950x, when counting connected edges to
vertices, I observed an improvement from 10.2 to 3.0 ms.
This most likely makes the counting less efficient, but it is
quite a nice performance improvement.

The new code was much slower for me at less than four threads,
so I added a check so that counting remains single threaded in
that case.

Pull Request: https://projects.blender.org/blender/blender/pulls/109628
2023-07-05 16:05:16 +02:00
Hans Goudey
19e2d7cd0e Fix: Incorrect name for calculate simulation job
Copy and paste mistake caused the job to have the same name as baking.
2023-07-05 08:28:00 -04:00
Hans Goudey
b0b5af5dd6 Cleanup: Remove outdated comment for Mesh geometry component 2023-07-05 08:27:03 -04:00
Martijn Versteegh
5201a55ea0 Fix #109057: Only extend polygons present in the mask.
The Texture margin 'adjacent faces' algorithm always used the
full UV map, even if not all polygons were actually part of the
baking. Remedy this by checking the mask if passed in.

Pull Request: https://projects.blender.org/blender/blender/pulls/109500
2023-07-05 14:20:28 +02:00
Falk David
4df8c942f1 Fix: Memory leak when copying a GP drawing
The copy constructor called the constructor of the drawing,
which meant that the `CurvesGeometry` was allocated twice.
2023-07-05 14:04:34 +02:00
Falk David
4d3574a4a5 Curves: Reimplement random selection with mask
Instead of manipulating the selection attribute directly, we get an `IndexMask` of the random elements, and then apply the changes to the selection attribute in the operator.

Pull Request: https://projects.blender.org/blender/blender/pulls/109366
2023-07-05 13:48:22 +02:00
Falk David
fde2eca1d2 GPv3: Select circle 2023-07-05 12:15:09 +02:00
Falk David
b19aaf6730 Refactor: GPv3: Add frame API 2023-07-05 12:05:23 +02:00
Pratik Borhade
b14435fd93 GPv3: Missing default tool for paint mode
This broke after introduction of new grease pencil
paint mode 3d99d05f00
Entry in `toolsystem_default_tool` was missing

Pull Request: https://projects.blender.org/blender/blender/pulls/109722
2023-07-05 12:03:51 +02:00
Sergey Sharybin
bad41885db Cleanup: Mark unused function arguments as such
A lot of such cases got discovered since recent change to CLang's
compiler flags for C++.

Pull Request: https://projects.blender.org/blender/blender/pulls/109732
2023-07-05 12:02:06 +02:00
Campbell Barton
66ea416457 Fix ANIM_SEQUENCE type path encode/decode error
The file-name would be included twice, because an_stringdec worked
differently to BLI_path_sequence_encode.
Use BLI_path_sequence_{encode/decode} to resolve the issue.

While image-sequence `anim` doesn't seem to be relied on, it's
possible to use this code-path by referencing an image from a movie
sequence strip.
2023-07-05 17:05:45 +10:00