Commit Graph

100751 Commits

Author SHA1 Message Date
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
Campbell Barton
b810fd75a4 Cleanup: use _exec suffix for operator callbacks
This was already the case for all but a few places.
2023-06-24 18:56:25 +10:00
Campbell Barton
b9bf639ba4 BLI_string: remove BLI_strcpy_rlen
Avoid BLI_strcpy_rlen use as this has the same problems as strcpy
(it just returned the length which is useful at times).
Use memcpy instead when the size is calculated immediately beforehand.

Other uses of have been replaced by BLI_string_join_array that prevents
buffer overruns by taking the destination buffer length.
2023-06-24 18:49:29 +10:00
Germano Cavalcante
9876ff183f Merge branch 'blender-v3.6-release' into main 2023-06-23 18:26:53 -03:00
Germano Cavalcante
f2fb22b94b Fix snap normal not in world-space
The algorithm that transforms space from local normal to world space was incorrect.

The problem is only observed with Align Rotation to Target on objects
with shear transformation.
2023-06-23 18:23:31 -03:00
Germano Cavalcante
1ef9c16218 Cleanup: Rename SCE_SNAP_MODE_ to SCE_SNAP_TO_
Also rename:
- `SCE_SNAP_MODE_FACE_NEAREST` to `SCE_SNAP_INDIVIDUAL_NEAREST`
- `SCE_SNAP_MODE_FACE_RAYCAST` to `SCE_SNAP_INDIVIDUAL_PROJECT`

And arrange the enums in numerical order.
2023-06-23 17:16:10 -03:00
Hans Goudey
e570f13616 Cleanup: Move NOD_geometry.h to C++
Pull Request: https://projects.blender.org/blender/blender/pulls/109306
2023-06-23 22:15:42 +02:00
Hans Goudey
9b708c8650 Revert "Fix: Revert changes in Mesh to Volume node and modifier to Blender 3.6"
This reverts commit 0b0a5d21ac.

The breaking changes in that commit have been postponed to 4.0.
2023-06-23 14:14:17 -04:00
Jacques Lucke
537fdbbfa2 Fix: Revert changes in Mesh to Volume node and modifier to Blender 3.6
This brings back the `Fill Volume` and `Exterior Bandwidth` inputs in
the Mesh to Volume node and modifier. Those existed in Blender 3.5 but
were removed in 700d168a5c because the way they were
implemented did not use the openvdb api in the right way.

While it's rare that people turned off the `Fill Volume` option, the
exterior bandwidth was used more and can have significant impact on
the result. Furthermore, there is no clear replacement for the
functionality.

Therefore, we decided to roll back the changes in 3.6 to avoid breaking
compatibility. We intend to keep the changes in 4.0 for now, but need
to work on a more clear short term replacement for the removed
functionality.

Pull Request: https://projects.blender.org/blender/blender/pulls/109297
2023-06-23 14:14:17 -04:00