Commit Graph

100653 Commits

Author SHA1 Message Date
Julian Eisel
fcd1bb170c Cleanup: Use const for File Browser file list queries 2023-06-22 13:09:40 +02:00
Pratik Borhade
c1d6f8b567 Fix: change poll function for add and remove layer operators
Current poll functions allows to use these operator only in edit mode.
Correct function would be `active_grease_pencil_poll` (check for active grease
pencil object instead of the context mode)

Pull Request: https://projects.blender.org/blender/blender/pulls/109238
2023-06-22 13:04:47 +02:00
Omar Emara
d6cd3db13b Fix: Wrong reference count for shader operation
The reference count computation for shader operation outputs is wrong,
because it considers internal links as references to the result, which
is not the case.

This patch fixes that by only consider external links.
2023-06-22 13:57:31 +03:00
Campbell Barton
2ff522c23f CMake: show install hint for ninja as well as make
Use the absolute destination path in the message too as the path
relative to the CMAKE_INSTALL_PREFIX isn't so meaningful.
2023-06-22 20:28:03 +10:00
Falk David
16e187778b Fix compiler warnings 2023-06-22 11:11:55 +02:00
Falk David
b3f3b41d09 GPv3: Initial Layer Tree UI
Adds a new UI template to view the current layer tree of the active Grease Pencil object.

This UI tree view implements the following features (for now):
 - Displaying all the layers with their names and highlighting the active layer.
 - Changing the active layer by clicking on an item.
 - Adding new layers (using a new operator).
 - Removing the active layer (using a new operator).
 - Renaming a layer.

Pull Request: https://projects.blender.org/blender/blender/pulls/109197
2023-06-22 10:51:43 +02:00
Jeroen Bakker
48867f9798 Cleanup: make format 2023-06-22 08:22:21 +02:00
Germano Cavalcante
77b061f641 Transform Snap: Convert callbacks to virtual methods in subclasses
This commit converts existing callbacks into virtual methods and moves
their associated members from the base class to custom implementations
in subclasses.

These callbacks, (previously used within the main struct), have been
replaced by pure virtual methods in the `Nearest2dUserData` class.

As a result, specific subclasses can now provide their own customized
implementations for these methods.
2023-06-22 01:11:08 -03:00
Campbell Barton
7d7ac591c8 Cleanup: minor changes to BKE_appdir_font_folder_default
- Ensure a trailing slash in BKE_blendfile_userdef_from_defaults
  instead of in-line platform specific checks.
- Take a buffer size argument for the directory.
- Use the documented size for SHGetSpecialFolderPathW wchar_t argument.
- Remove use of unsafe `wcscat` on WIN32
2023-06-22 13:42:27 +10:00
Campbell Barton
944663723a Fix the default directory for opening fonts
- By default on Linux the directory would be "/usr/share/" with
  "fonts" as the filename, now fonts is always treated as a directory.
- Correct the path for linked library fonts using a relative path.
2023-06-22 13:18:05 +10:00
Campbell Barton
98b973294b Cleanup: spelling in comments 2023-06-22 12:35:48 +10:00
Germano Cavalcante
4d1593c4ad Transform Snap: Improve snap for bones
In order to better identify which is the normal of the point
(see #108711), it is interesting to identify which is the closest bone.

So, instead of testing the snap at each point and then each bone line,
test the bone lines first and after identifying the closest one, test
its points.

With the nearest bone identified, we can use its normal instead.
2023-06-21 21:22:30 -03:00
Germano Cavalcante
48ab99f54a Cleanup: Simplify transformation from normal to global space
Just multiply the original matrix without the translation
component.
2023-06-21 21:22:30 -03:00
Germano Cavalcante
93e008dd8b Transform Snap: Support 'Align Rotation to Target' for bone points
Align with the bone that the point is part of.

Ref #108711
2023-06-21 19:59:16 -03:00
Germano Cavalcante
dea93845af Fix #108711: Snap with Align Rotation to Target do not align rotation for Empties or Bone
For now it only supports the body of the bone.

Head and tail will be supported later.
2023-06-21 19:37:02 -03:00
Germano Cavalcante
4585c8b28d Transform Snap: Remove parameter and use a more descriptive name
`sctx` can be accessed internally.

And `clip_planes_enable` makes it clearer what this method does.

Also note that this function had been accidentally removed for Cameras.
2023-06-21 18:41:08 -03:00
Germano Cavalcante
9ec127bb70 Transform Snap: Deduplicate code that register the result
The `Nearest2dUserData` object is called in all cases, so move the
registration to its destructor.
2023-06-21 18:24:15 -03:00
Germano Cavalcante
3bbd99e1cb Transform Snap: Remove unnecessary member 2023-06-21 18:23:59 -03:00
Germano Cavalcante
046e5f72e6 Cleanup: Split transform_snap_object.cc into multiple files
Split into:
- transform_snap_object_armature.cc
- transform_snap_object_camera.cc
- transform_snap_object_curve.cc
tmp

tmp
2023-06-21 18:12:00 -03:00
Jacques Lucke
2b4ea3c38a Fix #109209: crash when attributes are propagated to non-first output geometry
This wasn't covered by my other tests because in usually the geometry output
that anonymous attributes are propagated to is the first output, thus the index
was 0. In this case it didn't make it difference whether the `.index_range()` call
was there are not.
2023-06-21 22:36:58 +02:00
Germano Cavalcante
f23aac659a Fix multiple snap of Vertex and Edge Perpendicular
Caused by c83e37d354.

The lambda variable is being changed to perpendicular, but the original
value needs to be used for vertex snap.
2023-06-21 17:08:38 -03:00
Hans Goudey
cb07162c74 Cleanup: Remove unnecessary C wrappers from Mesh RNA 2023-06-21 15:35:22 -04:00
Hans Goudey
c0632e175c Merge branch 'blender-v3.6-release' 2023-06-21 13:42:33 -04:00
Hans Goudey
00f88babed Fix #109042: Bake from multires different from previous versions
The fix is the same as d622673f4b and 85bd64ece4.
2023-06-21 13:37:25 -04:00
Germano Cavalcante
13beb4ce35 Fix snapping for Curve or Armature failing
Caused by c83e37d354
2023-06-21 14:22:39 -03:00
Brecht Van Lommel
5c240c9e29 Revert "Fix unnecessary corner edge computation in multires bake"
This reverts commit ef9d9c6856. Actually probably better to leave
this in, since it may be used by normal computation even if seemed to
work ok in tests.
2023-06-21 18:54:28 +02:00
Brecht Van Lommel
ef9d9c6856 Fix unnecessary corner edge computation in multires bake
The root of the bug was wrong edges, but it wasn't necessary to compute
corner edges at all and this was unnecessarily added in 16fbadde36.

Ref #109161
2023-06-21 18:49:46 +02:00
Omar Emara
75b519eb89 Fix: Sun Beams shader does not work on Metal
Metal does not support the length function on integer vectors, so
explicitly cast to a float one.
2023-06-21 19:48:33 +03:00
Hans Goudey
c9221323f2 Merge branch 'blender-v3.6-release' 2023-06-21 12:42:51 -04:00
Hans Goudey
d622673f4b Fix #109161: Baking freeze with invalid edge array
The old subsurf DerivedMesh code creates an edge layer
without initializing it, which makes the proper lazy initialization
of the edge layer later think that it's already finished. To avoid that,
remove the edges when creating the DerivedMesh at first.

Similar to 85bd64ece4
2023-06-21 12:40:36 -04:00
Falk David
bb041b3f48 Fix #109207: Can't select in gpencil edit mode
This was due to a wrong mapping of tools in the toolbar.

The fix makes sure that the correct selection tools are used for the
old grease pencil objects.
In order to accomplish this properly, the new grease pencil objects
use their own edit mode context.
This way the two objects are cleanly seperated.
2023-06-21 16:49:18 +02:00
Bastien Montagne
738264c7d6 Merge remote-tracking branch 'upstream/blender-v3.6-release'
Conflicts:
	source/blender/editors/uvedit/uvedit_select.cc
2023-06-21 16:47:05 +02:00
Damien Picard
58c6a278d3 I18n: remove context translation from node title
The node title was translated in two steps: first using the
BLT_I18NCONTEXT_ID_NODETREE context, and if that failed, using the
default context.

As far as I could find, the only node using this intentionally is the
Frame node, but its title is only displayed in the Add Menu.

However, at least one node has a bad translation because its name was
extracted independently with the NodeTree context: the compositing
Scale node uses a translation which is only appropriate in a vector
math context.

This commit removes the double translation step. If needed by
translators, a translation context in the node RNA could be introduced
at a later time.

Pull Request: https://projects.blender.org/blender/blender/pulls/108241
2023-06-21 16:43:19 +02:00
Damien Picard
386c653855 I18n: translate new sequence strip names
Newly added sequence strip names can be translated as user data. This
commit adds the appropriate `DATA_()` macros.

Pull Request: https://projects.blender.org/blender/blender/pulls/109058
2023-06-21 16:41:13 +02:00
Germano Cavalcante
e9eb8b3cc4 Cleanup: Use BLI_timeit in C++ code
And prefer `std::cout` instead of `printf`.
2023-06-21 11:39:18 -03:00
Damien Picard
037e5787a5 I18n: extract missing enum items for the Select Similar UV operator
The Select Similar UV operator defined multiple enum item arrays, and
returned one depending on current mode in the enum function
uv_select_similar_type_itemf().

The operator prop's enum items used only the vertex items, which
resulted in several items never being extracted because they were
dynamically generated instead of exposed to the RNA.

This commit groups all items in a single array so that they are
exposed, but uses the enum function to filter them.

Issue reported by Satoshi Yamasaki (@SatoshiYamasaki) in #43295.

Pull Request: https://projects.blender.org/blender/blender/pulls/108994
2023-06-21 16:37:54 +02:00
Jacques Lucke
ca25fc89bf Merge branch 'blender-v3.6-release' 2023-06-21 16:06:30 +02:00
Jacques Lucke
571aaa0e92 Fix: zero interior band width leads to no volume output
The input only determines the gradient of the volume density at its surface.
Using zero there should not break it.

Pull Request: https://projects.blender.org/blender/blender/pulls/109208
2023-06-21 16:05:47 +02:00
Iliya Katueshenock
ff528626f4 Fix #108344: default result buffer must be initially contain values
Caused by 15f464019a.

Now make sure that the `result_buffer` is properly initialized, because
it may be used when trying to blur on an unsupported attribute domain.

Pull Request: https://projects.blender.org/blender/blender/pulls/108347
2023-06-21 16:04:12 +02:00
Iliya Katueshenock
716cc72b96 Fix #108344: default result buffer must be initially contain values
Caused by 15f464019a.

Now make sure that the `result_buffer` is properly initialized, because
it may be used when trying to blur on an unsupported attribute domain.

Pull Request: https://projects.blender.org/blender/blender/pulls/108347
2023-06-21 16:02:20 +02:00
Bastien Montagne
94e6ab6d71 Fix #108923: Serious issues in 'undo_preserve' process of Scene's toolsettings.
By removing the extra complete check/remapping of ID pointers in undo
case, ebb5643e59 merely revealed how broken the 'undo_preserve' code of
Scene was.

It cumulated a flock of issues, all more or less related to ID pointers:
* 'source of truth' should be the _old_ data (toolsettings), not the new
  one, since this is the one kept at the end of the process;
* In some cases, some paint data may exist in one, but not the other
  of the two 'old' and 'new' toolsettings data.
* Since this data is preserved to its latest version accross undos, its
  ID pointers can become completely unrelated to these read from the
  undo memfile, _even when the Scene itself is detected as unchanged_!
  This implies that:
  + undo_preserve code has to be called even when there is no liblinking
    (when the ID is detected as unchanged and re-used 'as-is').
  + Using existing ID addresses to find/validate an ID pointer in
    undo_preserve process is like playing Russian roulette - invalid
    memory access and crash is guaranteed at some point or another.
    Use `session_uuid` value instead to ensure a valid ID pointer is set
    (or null in case none can be found).

NOTE: while these issues also exist in previous releases (including both
latest LTSs), they were hidden by the code later in `setup_app_data`,
preventing any crash to happen. So backporting this fix would be far too
risky for a very minimal benefit imho.
2023-06-21 15:37:39 +02:00
Bastien Montagne
b5db6fe5d2 BLO: Add a new API call to find IDs in newly read Main from a session_uuid.
Needed for upcomming fix in Scene's undo_preserve code.
2023-06-21 15:37:39 +02:00
Bastien Montagne
6d1f34a15f IDManagement: libquery: Add macro taking pointer to ID pointers as parameters.
Needed to simplify upcomming fix in Scene undo_preserve code.

NOTE: also renamed 'private' macro parameter names to follow C++ classes
convention (one trailing `_`, instead of one or two leading `_` - the
two `__` leading ones are triggering complains from IDE regarding reserved
identifier names when the relevant macros are used in C++ files).

No expected behavior changes with this commit.
2023-06-21 15:37:39 +02:00
Brecht Van Lommel
d9da86dd15 Refactor: move Cycles versioning into regular versioning files
It's confusing to have it separately, and could lead to potential bugs in the
future if there is some versioning depending on the order.

Pull Request: https://projects.blender.org/blender/blender/pulls/109166
2023-06-21 15:20:15 +02:00
Brecht Van Lommel
f4e6981513 Merge branch 'blender-v3.6-release' into main 2023-06-21 15:15:23 +02:00
Brecht Van Lommel
17fa168a3d Linux: add launcher script to fix issue launching on Steam
The steam environment sets LD_LIBRARY_PATH with a libtbb.so.2 that is
incompatible with our own. This wrapper scripts gives our own library
priority.

There is a more modern "Steam Linux Runtime" that can be used instead of
the "LD_LIBRARY_PATH Steam Runtime" and which launches Blender, but it
fails to detect GPU compute libraries. So that was not an option.

Ref #107385

Pull Request: https://projects.blender.org/blender/blender/pulls/109169
2023-06-21 14:49:27 +02:00
Jacques Lucke
c38dd2da2b Fix: geometry nodes modifier property not working after changing it in Python
Same as 9f30555faf but the fix had to
change a bit in `main` compared to `blender-v3.6-release` due to a refactor.
2023-06-21 14:16:36 +02:00
Jacques Lucke
9f30555faf Fix: geometry nodes modifier property not working after changing it in Python
This affected only vector and color inputs. The issue was that those were
expected to be stored as float-array properties. However, when setting them
from python using `modifier["Input_X"] = [1, 2, 3]` the array type becomes
either `int` or `double`, but not `float`. A workaround was to use
`modifier["Input_X"][:] = [1, 2, 3]` as this changes the property inplace.

Now `int` and `double` arrays are also understood by the modifier.

Pull Request: https://projects.blender.org/blender/blender/pulls/109203
2023-06-21 14:00:41 +02:00
Joseph Eagar
1347640e38 Sculpt: Fix #109112: Connected island code broken for multires 2023-06-21 02:19:48 -07:00
Joseph Eagar
93020db5e0 Sculpt: Fix #109112: Connected island code broken for multires 2023-06-21 02:19:00 -07:00