Commit Graph

100759 Commits

Author SHA1 Message Date
Falk David
34d65eff1b Fix: Memory leak in grease_pencil.layer_reorder 2023-06-26 18:14:05 +02:00
Falk David
3d4cdd6b88 Fix: Typo in grease_pencil.layer_add description 2023-06-26 18:14:05 +02:00
Germano Cavalcante
9b1e56f013 Transform: Show Snap Base when adding multiple snap points
This is part of what was implemented in #109062

When adding multiple snap points (`A` key), the 'Snap Base' location no longer corresponds to the snap target point, so it becomes invisible.

Therefore, show the resulting `Snap Base` during this operation.

Pull Request: https://projects.blender.org/blender/blender/pulls/109379
2023-06-26 17:41:15 +02:00
Falk David
b69bba25ad GPv3: Add python endpoint to get/set active layer 2023-06-26 17:04:15 +02:00
Falk David
9f05936212 GPv3: Change name_plural to "grease_pencils_v3"
This is more consistent with the rest of the RNA names used.
2023-06-26 17:04:15 +02:00
Almaz Shinbay
4094cd207a Outliner: Remove isExpandValid() from AbstractTreeElement and its sub-classes
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.

Removes `isExpandValid()` from `AbstractTreeElement` and its sub-classes as all ID elements are ported to new tree-element code design. It was meant to be temporary for this transition phase.

Pull Request: https://projects.blender.org/blender/blender/pulls/109380
2023-06-26 16:59:44 +02:00
Julian Eisel
adb370e6ba UI: Use new C++ button apply function
No user visible changes expected.

This function was added in 86b2cf4574 as a more type safe and more
convenient way of setting button callbacks. So use it for simple cases.
2023-06-26 16:56:05 +02:00
Julian Eisel
0b19ab2cde UI: Add type-safe C++ button apply function object
No user visible changes expected.

Rather than relying on a C-style function pointer with void pointer
arguments, allow storing a `std::function` object, which can hold
arbitrary data in a type safe way. This can be conveniently used with
lambdas for example.

This is not used yet, but will be with #104831 merged. Replacing the
existing C-style callback uses with this can be done separately.

Pull Request: https://projects.blender.org/blender/blender/pulls/109016
2023-06-26 16:39:51 +02:00
Germano Cavalcante
c856d29e9f Fix assert in recent commit
It was supposed to be `!=` instead of `==`.
2023-06-26 11:20:41 -03:00
Almaz Shinbay
89f61015d1 Outliner: Port remaining ID 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 default expansion for `TreeElementID`, removing the need for `outliner_add_id_contents()`.

Pull Request: https://projects.blender.org/blender/blender/pulls/109256
2023-06-26 16:11:30 +02:00
Germano Cavalcante
c02333f37e Fix snap to perpendicular acting on default Snap Base
Snap to Edge Perpendicular has been disabled in Set Snap Base.
2023-06-26 11:03:47 -03:00
Germano Cavalcante
bfe4fb92f9 Fix #109346: Strange snapping behaviour
The problem was caused because the `Nearest2dUserData::obmat_` member
was deallocated in derived classes even before the main class
destructor was called.

This is strange behavior and only seen in Mac or Linux Release builds.

The solution is to not rely on the destructor to register snap values.

So create a separate function.
2023-06-26 10:52:50 -03:00
Falk David
2418252ea7 Refactor: Move stroke_cache to gpencil runtime
This moves the `stroke_cache` that was previously stored on every
drawing to the `GreasePencilRuntime` struct.

Since this cache is only used for when a user is drawing a stroke, there
can only ever be one. It makes more sense to have this cache on the
data-block runtime data, rather than every drawings runtime data.
2023-06-26 15:49:18 +02:00
Falk David
5dd29c9a05 Fix: Uses of foreach_editable_drawing callbacks
Some of the uses of the API have not been updated properly.
2023-06-26 15:19:12 +02:00
Miguel Pozo
97d6b5ad72 Fix GCC warnings 2023-06-26 15:11:11 +02:00
Damien Picard
44d012ce1d I18n: disambiguate a few messages
- "Front"/"Back": 'put something at the front/back' or 'the front/back
  face of something'. (e. g. the Empty Image options, Depth and Side
  option, both use the same strings as enum, which should be avoided
  in some languages).
- "Flip": invert, as in normals, or mirror, as in an image.
- "Path": a path to a resource, in general a file but sometimes a
  datablock, as opposed to a trajectory in space.
- "Join": disambiguate for the Grease Pencil operator, which may use a
  different word as that for meshes.
- "Wave": an ondulating motion, as opposed to a fluid dynamics motion.
- "Step": can mean the distance between two things, or a number of
  times to do something. In this case it is better to use the plural.
- "Edge": generally the edges of a mesh, but can also mean edge
  detection. Additionally, it was used for the option to enable
  Freestyle. This was changed to "Use Freestyle".
- "Boundary": the limit of a grease pencil drawing for filling
  purposes, as opposed to the external limit of a (non-manifold) mesh.
- "Rotations": can be translated to something like "Turns", in the
  context of a spiral.

Pull Request: https://projects.blender.org/blender/blender/pulls/108213
2023-06-26 15:07:06 +02:00
Falk David
0a693165c8 Refactor: Move GreasePencilDrawing functionality
Moves the functions from `GreasePencilDrawing` to a C++ wrapper class.
2023-06-26 14:58:42 +02:00
Jacques Lucke
af476f6a62 Nodes: fix zone detection for some special cases
This fixes crashes in the cases when:
* Two zones have a cyclic parent relationship.
* A node has more than one direct parent zone.
2023-06-26 14:33:37 +02:00
Jeroen Bakker
60a3dbaba9 Cleanup make format 2023-06-26 14:20:31 +02:00
Jeroen Bakker
29ad8750a5 Merge branch 'blender-v3.6-release' 2023-06-26 14:16:22 +02:00
Jeroen Bakker
f7d46d0644 Fix 107322: MacOS/ATI Crash When Starting Eevee
When using ATI GPU on MacOS/Metal compilation of Eevee shaders crashed due to an infinitive
loop in the compiler backend. This change fixes this by using a more reliable loop that
ensures that the loop will be finite.

Thanks for the Apple developers working on finding the root cause and Michael Parking White
for the initial fix.

Fixes #107322
Fixes #107451

Pull Request: https://projects.blender.org/blender/blender/pulls/109358
2023-06-26 14:12:45 +02:00
Falk David
497f9a6941 GPv3: Add operator to reorder the active layer
This operator will reorder the active layer (if there is one) to be above or below the target layer (specified by name).

Pull Request: https://projects.blender.org/blender/blender/pulls/109369
2023-06-26 14:03:28 +02:00
Iliya Katueshenock
d392a8f111 Fix (unreported): Memory leak when adding strip in VSE
Using unsupported movie file when adding movie strip causes memory leak.

Pull Request: https://projects.blender.org/blender/blender/pulls/109078
2023-06-26 13:57:33 +02:00
Damien Picard
9d5ab0a88f I18n: fix translation of undo history
The Undo History menu displays each undo step's name. These are either
operators or property names. Operators are translated upon display,
and they use the operator name. Currently, many of them are not
translated because they do not use the proper translation
context.

This commit changes the translation context to
BLT_I18NCONTEXT_OPERATOR_DEFAULT ("Operator").

Pull Request: https://projects.blender.org/blender/blender/pulls/108872
2023-06-26 12:55:52 +02:00
Bastien Montagne
21f5c7c45f Merge branch 'blender-v3.6-release' 2023-06-26 12:37:11 +02:00
Iliya Katueshenock
5f2368753a Fix #109307: memory leak changing simulation item name
Pull Request: https://projects.blender.org/blender/blender/pulls/109324
2023-06-26 12:33:13 +02:00
Falk David
befe6cb95c Fix: Unlinking GP layer from layer group
The `unlink_layer` function did not clear the parent pointer of the
layer itself.
2023-06-26 12:20:58 +02:00
Falk David
36b6b11d7d Cleanup: Remove unused function
The `bke::greasepencil::LayerGroup::remove_child` function was not used.
2023-06-26 12:20:58 +02:00
Philipp Oeser
f8981b6492 Pyhon API: Add animation playback pre/post handlers
Since d8388ef36a, the "frame_change_post" handler could not be used
anymore to detect when animation playback stopped.

This functionality is needed by certain addons though and is generally
usefull to have, so this is now added.

Related reports : #109168, #109218

Pull Request: https://projects.blender.org/blender/blender/pulls/109232
2023-06-26 12:11:25 +02:00
Miguel Pozo
b14b67db40 Workbench Next: Sculpt Support
Add Sculpt support for the new Draw Manager
and implement Sculpt rendering in Workbench Next.
Instead of using a callback approach, it's now possible to
retrieve a vector of GPUBatches and their material index,
so engines can use them as they see fit.

Pull Request: https://projects.blender.org/blender/blender/pulls/109294
2023-06-26 11:56:10 +02:00
Colin Basnett
7797fcc3c9 Nodes: Don't allow animation for node mute property
Discussions on https://projects.blender.org/blender/blender/pulls/108634 pointed to the idea that the mute property probably shouldn't have been animateable to begin with because of performance concerns.

This simply removes the ability to animate the property.

Pull Request: https://projects.blender.org/blender/blender/pulls/108849
2023-06-26 11:40:12 +02:00
Falk David
c5a8a74f9e Refactor: Convert several animation editor files to C++
Pull Request: https://projects.blender.org/blender/blender/pulls/109251
2023-06-26 11:27:25 +02:00
Falk David
32be07845f Curves: Mask function for end points
This essentially replaces the `ed::curves::select_ends` function by using a new masking function (`ed::curves::end_points`) and manipulating the selection attribute directly in the operators.

Pull Request: https://projects.blender.org/blender/blender/pulls/109293
2023-06-26 11:21:16 +02:00
Harley Acheson
4a80d0b6d5 Refactor: UTF-8 Character Defines
Use defined UTF-8 Universal character names in place of byte escape
sequences and literals.

Pull Request: https://projects.blender.org/blender/blender/pulls/109163
2023-06-26 06:05:18 +02:00
Campbell Barton
54e346f1d5 Cleanup: move run-time VFont enum out of DNA 2023-06-26 13:09:06 +10:00
Iliya Katueshenock
39386175e1 Fix: Incorrect rotation socket hiding in raycast node
The typo was made in 63dae2a105.

Pull Request: https://projects.blender.org/blender/blender/pulls/109352
2023-06-26 03:27:34 +02:00
Campbell Barton
82d9eb09db Cleanup: use term SIZE instead of LEN for defines for buffer sizes
Reserve "LEN" for lengths that don't include the null byte.
2023-06-26 10:09:57 +10:00
Germano Cavalcante
9cbe156d6a Fix snap to origin of objects made behind camera
The clip plane start was being ignored in this case.
2023-06-25 10:30:16 -03:00
Campbell Barton
9a4e823f3f Cleanup: minor changes to string join logic
- When string join truncates, break out of the outer loop too.
- Use BLI_string_len_array when calculating the array size for
  BLI_string_join_array_by_sep_charN.
- Add tests.
2023-06-25 16:45:02 +10:00
Campbell Barton
2c214d5bb5 Fix error in recent removal of BLI_strcpy_rlen
Mistake in caused [0] the string not to be nil terminated.

[0]: b9bf639ba4
2023-06-25 15:25:54 +10:00
Campbell Barton
f4a65cfe5d BLI_string: remove potentially unsafe BLI_sprintf
Replace by BLI_snprintf or string joining.

See #108917.
2023-06-25 13:34:31 +10:00
Campbell Barton
85029da289 Cleanup: compiler warnings 2023-06-25 11:39:25 +10:00
Habib Gahbiche
c8f434e685 Compositor: improve edge detection of Kuwahara filter
Compute edges of image once based on luminance instead of all 3 channels.

This also gives a modest performance improvement of 8%. Measured on intel i9 CPU using a 1920 x 3199 image.

Pull Request: https://projects.blender.org/blender/blender/pulls/108858
2023-06-24 21:39:07 +02:00
Hans Goudey
c1292b4a80 Revert "Fix: Revert changes in Mesh to Volume node and modifier to Blender 3.6"
This reverts commit 537fdbbfa2.

Somehow the revert in 9b708c8650
was undone by the next merge from the 3.6 branch,
9876ff183f.
2023-06-24 14:11:17 -04:00
Weizhen Huang
d4830d711e Cleanup: remove comments regarding Cycles versioning 2023-06-24 19:51:37 +02:00
Clément Foucault
8fd824c4b7 Fix #109314: Metal Debug 'Shaders' Folder appearing in 3.6 &. 4.0
This slipped through a previous Metal PR #107175.

Pull Request: https://projects.blender.org/blender/blender/pulls/109323
2023-06-24 17:40:46 +02:00
Pratik Borhade
51a5be8913 GPv3: Change poll function of select alternate operator
This operator is only supported in point selection mode.
2023-06-24 17:58:53 +05:30
Omar Emara
c9e6399fe1 Realtime Compositor: Implement Keying node
This patch implements the Keying node for the realtime compositor. To
ease the implementation, some morphological operators were moved into
algorithms and a mechanism to steal data between results was added to
the Result class.

Pull Request: https://projects.blender.org/blender/blender/pulls/108393
2023-06-24 13:02:33 +02:00
Campbell Barton
ec428c3f7f CMake: sort file lists, add missing header 2023-06-24 19:05:09 +10:00
Campbell Barton
baa8450fbf License headers: add SPDX-FileCopyrightText 2023-06-24 19:03:06 +10:00