Commit Graph

130653 Commits

Author SHA1 Message Date
Hans Goudey
13c145ac02 Cleanup: Grammar in a few comments 2023-11-29 12:39:33 -05:00
Hans Goudey
8c59532106 Cleanup: Use C++ arrays to store subdiv ccg data
Decrease the amount of manual memory management
and pointer arithmetic.
2023-11-29 12:39:33 -05:00
Philipp Oeser
d3ff658b66 Fix #115572: shape_key_remove operator leaves shared normals
Caused by 383a145a19

Since above commit, normals were in a SharedCache, they need to be tagged dirty
for recalculation.

Instead of tagging the normals caches dirty explicitly, simply use
`BKE_mesh_tag_positions_changed` [which includes all this and also tags
positions dirty - which sounds also needed for updating other things]

Pull Request: https://projects.blender.org/blender/blender/pulls/115580
2023-11-29 18:17:30 +01:00
Hans Goudey
c2571cd259 Cleanup: Use const SubdivCCGFace variables 2023-11-29 11:47:00 -05:00
Hans Goudey
1a36feb7e5 Cleanup: Use references instead of pointers in subdiv_ccg.cc 2023-11-29 11:40:10 -05:00
Hans Goudey
63af8dbfca Multires: Use IndexMask for Subdiv CCG face updates
These updates are used to recalculate normals and average values between
grid boundaries during multires sculpting. In main the affected faces
are passed as an array of pointers. Using an `IndexMask` instead reduces
memory usage by 4x per affected face (8 byte pointer to 2 byte integer),
simplifies iteration and threading, and can also improve performance.
Finding which faces are affected is now multithreaded, with its runtime
changing from 0.63 ms to 0.12 ms in a simple test sculpting on a portion
of a 1 million face grid.

Also switch to VectorSet instead of GHash for finding affected adjacent
elements. That's a friendlier data structure that probably has better
performance as well.
2023-11-29 11:10:08 -05:00
Hans Goudey
dfc6b1deb6 Cleanup: Use C++ threading API in subdiv_ccg.cc
Allows removing various structs for passing around arguments,
and simplifies the use of thread-local storage.
2023-11-29 10:35:21 -05:00
Hans Goudey
c28cb3d0ac Cleanup: Remove unused curve positions variable 2023-11-29 10:35:21 -05:00
Germano Cavalcante
db3d59d94d Fix #115570: Crash when using snap to volume and clipping region
`ED_view3d_win_to_ray_clipped_ex` requires `ray_end` when
`do_clip_planes` is true.

Since the snap code uses `ray_depth` instead of `ray_end`, the solution
is to always calculate the `ray_end` and convert to `ray_depth` when
necessary.
2023-11-29 12:33:08 -03:00
Lukas Tönne
5bc82b5b7c Geometry Nodes: Remove experimental volume nodes
The new grid socket (#115270) will make these nodes obsolete and
provide more elegant ways of implementing the features. Removing
these nodes now to clean up and make future changes simpler.

Pull Request: https://projects.blender.org/blender/blender/pulls/115567
2023-11-29 16:02:06 +01:00
Miguel Pozo
21712cf746 Fix: EEVEE-Next: Object::visibility_flag in material_sync
Take `OB_HIDE_SHADOW` into account. (fix #115488)
Include the relevant visibility flags into `MaterialKey`.

Pull Request: https://projects.blender.org/blender/blender/pulls/115575
2023-11-29 15:44:15 +01:00
Hans Goudey
aa2cdf283a Cleanup: Use proper type for subdiv CCG faces 2023-11-29 08:47:58 -05:00
Jacques Lucke
7c1a0e57ca Cleanup: remove unused code 2023-11-29 14:35:04 +01:00
Iliya Katueshenock
2ce4c4e8d2 Fix #115548: Missed sort after multithreaded algorithm
To make sure result is deterministic, sorting is used.
This was missed in one of last speedup.

Pull Request: https://projects.blender.org/blender/blender/pulls/115568
2023-11-29 14:16:37 +01:00
Jacques Lucke
7a7b7196f9 Geometry Nodes: extract global data passed to a geometry nodes invocation to separate struct
This avoids some duplication between the modifier and operator evaluation
contexts and also makes it easier to make independent from a specific
evaluation context (so e.g. the simulation nodes code shouldn't care whether
it's used from a modifier or operator.

Pull Request: https://projects.blender.org/blender/blender/pulls/115512
2023-11-29 13:22:20 +01:00
casey bianco-davis
1970de9d19 GPv3: Fix #113994: Overlay: Hide points for locked layers.
This makes so that locked layers don't show the points and the lines aren't visibly selected.

This separate the batch ensure function into two function, one for handling the visible grease pencil batch and one for handling the edit mode overlay batch.

This also makes it so that only selected curves show the points that make up it, (this matches legacy grease pencil).

Pull Request: https://projects.blender.org/blender/blender/pulls/114751
2023-11-29 11:31:50 +01:00
Campbell Barton
807993d2b7 Cleanup: use single underscore prefixes
Double underscores are reserved for implementation macros.
2023-11-29 18:09:01 +11:00
Campbell Barton
a144fcfa50 Cleanup: declare values for enums that may be written into blend files 2023-11-29 17:37:04 +11:00
Campbell Barton
c7593cc99f Cleanup: replace MAX2 with std::max 2023-11-29 17:11:09 +11:00
Campbell Barton
3a01ba9a39 Cleanup: avoid STR_ELEM expanding into multiple function calls
Also add note since hard coded property name checks are generally
worth avoiding.
2023-11-29 16:33:01 +11:00
Campbell Barton
278e37f8ce Cleanup: use default initializers for members of GWL_Seat 2023-11-29 16:05:30 +11:00
Campbell Barton
994a93bd22 Fix "make doc_man" not working, after recent changes
Since [0] man page generation calls PYTHON directly.

[0]: 5486c70aae
2023-11-29 16:02:33 +11:00
Campbell Barton
a385a98e8e Cleanup: spelling in comments 2023-11-29 15:56:17 +11:00
Campbell Barton
b12edbcb9c Cleanup: format 2023-11-29 15:47:19 +11:00
Campbell Barton
258a083066 Fix #115160: Keyboard layout sometimes ignored on Wayland
When using multiple keyboard layouts, the first layout would always
be used for internal keyboard layout queries.

This meant for e.g. with English layouts QWERTY & DVORAK both active
Control-C always used the QWERTY location for C even when DVORAK was
active.

Resolve by detecting layout changes & run xkb_state_update_mask
on all xkb_state's so internal queries always use the active layout.

Based on !115161, extended to detect layout changes & account for all
internal states.

Co-authored-by: Eugene Kuznetsov <eugene.kuznetsov@amd.com>
2023-11-29 15:18:42 +11:00
Campbell Barton
85e2dd66a0 Fix #113059: file selector shrinks on each display under KDE
Under KDE the initial window size includes the window decorations.
Add a workaround to enforce the requested window size for new windows
under KDE.
2023-11-29 15:18:40 +11:00
Campbell Barton
44d6995b4c Cleanup: make hash sizes static, remove references to smallhash
Remove BLI_ghash_hash_sizes declaration it's only user (smallhash)
has been removed.
2023-11-29 15:13:05 +11:00
Hans Goudey
09caf59690 Fix #115298: Sculpt mask removed with undo involving mode change
Because reading memfile undo steps doesn't send the mesh through the
versioning code that converts legacy layers back to the new generic
format, we can't write the old format in undo steps. This same check
existed during the mesh struct of array refactor.
2023-11-28 16:58:45 -05:00
Hans Goudey
c083b3b8d2 Cleanup: Remove outdated normals comment for mesh validation
The validation function doesn't handle normals anymore,
since they are calculated lazily at runtime.
2023-11-28 16:50:52 -05:00
Hans Goudey
19b9b8d431 Cleanup: Move mesh looptri real edges function 2023-11-28 16:49:55 -05:00
Hans Goudey
aca27e5462 Cleanup: Store BVH and shrinkwrap data with C++ types 2023-11-28 16:40:43 -05:00
Hans Goudey
9271949f7b Cleanup: Remove unnecessary keywords from newly C++ headers 2023-11-28 16:13:09 -05:00
Hans Goudey
7e3ba529ea Cleanup: Move four blenkernel headers to C++ 2023-11-28 16:05:12 -05:00
Hans Goudey
991486c37f Cleanup: Remove/replace SmallHash data structure
Use blender::Set which is similar but offsers better type safety
and likely better performance as well. The only remaining user
was the mesh edit mode knife tool, and replacing that usage
with `Set` and `Map` was straightforward.
2023-11-28 14:03:53 -05:00
Hans Goudey
7020a4ff1a Cleanup: Remove unused voxel sampling functions
Last used in Blender internal renderer.
2023-11-28 13:30:18 -05:00
Hans Goudey
573b4728cb Cleanup: Remove unused BLI voronoi code
Unused after 75c947a467
2023-11-28 13:24:45 -05:00
Habib Gahbiche
ff083c1595 Compositor: UI: better node visibility for default node tree
Create default compositor node tree centred around x-axis, and with lower y-offset for better visibility

Pull Request: https://projects.blender.org/blender/blender/pulls/115439
2023-11-28 18:45:37 +01:00
Hans Goudey
81abaaad6b Fix #115521: Voxel remesh resets smooth with attribute propagation off
Add a special case for the sharp_face attribute to use the sharpness
of the first face, the same as before ba1c8fe6a5
2023-11-28 12:45:14 -05:00
Hans Goudey
321c1af26e Cleanup: Remove unnecessary mesh C-API functions 2023-11-28 12:26:51 -05:00
Hans Goudey
f2467f75b3 Cleanup: Remove mesh "vert coords" functions
Inlining the functions is simpler nowadays, since there are utility
functions to copy spans and tag the mesh caches dirty. Also use an
array instead of a raw pointer for multires.
Resolves #103789
2023-11-28 12:26:51 -05:00
Nathan Vegdahl
32e56879b7 Fix: missed some version bump code 2023-11-28 18:12:21 +01:00
Nathan Vegdahl
c9093332e0 Fix #115434: custom bone colors invisible in stick mode
The issue was that bone colors are only specified with 3 channels (RGB),
but they're stored as 4 channels for some reason.  So the fourth bogus
channel gets initialized to zero by default, which was then being
interpreted as zero alpha in some drawing modes.

This fixes the issue by ensuring that the fourth unused channel always
gets initialized to 255, and therefore can be validly interpreted as an
alpha channel.

Pull Request: https://projects.blender.org/blender/blender/pulls/115477
2023-11-28 18:04:11 +01:00
Hans Goudey
21a2390f4c BLI: Add utility to reverse index mask
This utility was already duplicated in two places and planned to be used
more. While we should usually avoid creating arrays the size of the
indexed array (rather than the size of the mask), sometimes it does seem
to be the best option, and we're helped by the fact that most memory
stays unintialized for a small mask (allocating but not writing to memory
pages at all generally isn't too expensive).

Pull Request: https://projects.blender.org/blender/blender/pulls/115491
2023-11-28 17:32:17 +01:00
Hans Goudey
ed23989e2e Geometry Nodes: Remove drag & drop requirement of geometry input
Generator node groups don't need to have a geometry input, and the error
will be displayed in the modifier after it's added if it really matters.
2023-11-28 11:06:54 -05:00
Antonio Vazquez
b9fba005bd GPv3: Lock unselect materials operator
Conversion of GPv2 operator

Pull Request: https://projects.blender.org/blender/blender/pulls/115278
2023-11-28 16:38:59 +01:00
Julian Eisel
86362f14f9 UI: Improve description of custom asset library type
Description added in 9c2330d821.

It is unclear what "external" in this case means, why these asset
libraries are considered "normal" (are the others not "normal"?) and the
term "asset repository" is wrong (should be "asset library").

I think this isn't actually shown in the UI currently in fact.
2023-11-28 16:22:30 +01:00
Julian Eisel
0156169a9c Fix #115431: Crash on right click on string button inside menu
Problem is the `UI_context_active_but_get()` lookup doesn't respect menu
regions, unlike the earier call to `UI_context_active_but_prop_get()`
(which is also used to validate the existence of an active button).

Using `UI_context_active_but_get_respect_menu()` instead would work, but
in fact the earlier lookup returns the active button if any, we just
didn't use that.
2023-11-28 16:03:01 +01:00
Julian Eisel
e3b3399bcb Cleanup: Add constructor/destructor for drag data to avoid includes
`wmDragActiveDropState` contains a `bContextStore` unique pointer, so
when constructing/destructing an object of this type `BKE_context.hh`
had to be included. It wouldn't be obvious why this include is necessary
in some cases. And the pointer is otherwise managed internally in the
source file, so the need for this include shouldn't bleed into other
files.

Make sure the unique pointer construction/destruction happens in the
translation unit of the source file that otherwise also manages it.

Avoids include in #107230.
2023-11-28 15:26:39 +01:00
Christoph Lendenfeld
265aebd7be Fix: FCurve colors on bones
New FCurves for bones were not automatically set to `FCURVE_COLOR_AUTO_RGB`
because the RNA path couldn't be resolved.

That was because the `PointerRNA` passed into the function points to the bone,
but the rna path is relative to the ID.
Fixed by resolving the path from the bones owner ID

Pull Request: https://projects.blender.org/blender/blender/pulls/115517
2023-11-28 13:29:46 +01:00
Campbell Barton
d96cdb2231 Cleanup: simplify Python API use running scripts
- Remove unnecessary exception if Py_CompileStringObject fails.
- Remove unnecessary PyErr_Occurred check if Py_CompileStringObject
  succeeds (based on incorrect assumption from [0]).
- Pass closeit=1 to PyRun_FileExFlags so it's responsible for closing
  the file before executing code.
- Remove unnecessary temporary ReportList.

[0]: b9f6d66328
2023-11-28 22:33:09 +11:00